Deadlock in System.Component.TypeDescriptor [closed]
Deadlock in System.Component.TypeDescriptor [closed]
Deadlock in System.Component.TypeDescriptor [closed]
Generic Repository vs Non-generic Repository Generic repository is not a pattern. Generic repository is just a wrapper. It can be useful for some special scenarios as a base class for specific repositories but in most cases it is just over used and over hyped nonsense. Navigation properties Repository itself should be used with aggregate root. … Read more
Short correction for SaveOptions.DetectChangesBeforeSave : this is the default. When you do ObjectContext.SaveChanges(), the method DetectChanges() is called to synchronized attach entities in the OSM. SaveChanges is an overloaded version of SaveChanges(SaveOptions optsions) method, where this parameterless version calls this SaveChanges(SaveOptions.DetectChangesBeforeSave | SaveOptions.AcceptAllChangesAfterSave) SaveOptions is a Flag enum and in conclusion, SaveOptions.DetectChangesBeforeSave | SaveOptions.AcceptAllChangesAfterSave is … Read more
In VS2012 it’s much easier: just press alt + up/down with the property selected.
For me STE is absolutely wrong concept. It is just another implementation of DataSet. In ASP.NET application you will have to store STEs somewhere among requests. In first request you will query your datasource to get STE and provide data in the page. In the next request (postback) you will want to modify STE with … Read more
I think by “not using EF ORM designer” you mean new DbContext API from EF 4.1. Because if you don’t mean DbContext API you still have to use EDMX (designer). You can either use data annotations (System.ComponentModel.DataAnnotations): KeyAttribute and ForeignKeyAttribute: public class Registry { public virtual int Id { get; set; } public virtual MyEntity … Read more
In the IIS Manager select your server and select “Application Pools“. Select the application pool used by your Web App and click on “Advanced Settings” from the right hand menu. In the “General Section” of the advanced Settings click on the “Enable 32-bit Applications” and set it to True. This fix only applies to 64-bit … Read more
DbContext has method for this: var set = context.Set<MyEntity>();
This is wrong “virtual” keyword is used for not loading the entities unless you explicit this (using an “Include” statement) Lazy Loading means that entities will be automatically loaded when you first access collection or navigation property, and that will happen transparently, as though they were always loaded with parent object. Using “include” is loading … Read more
You can specify the StringLength attribute as follows on numerous properties [StringLength(20, ErrorMessageResourceName = “StringLengthMessage”, ErrorMessageResourceType = typeof(Resource))] public string OfficePhone { get; set; } [StringLength(20, ErrorMessageResourceName = “StringLengthMessage”, ErrorMessageResourceType = typeof(Resource))] public string CellPhone { get; set; } and add the string resource (named StringLengthMessage) in your resource file “Maximum length is {1}” Message … Read more