Is there a way to export the .edmx diagram from VS2008 to Visio?
You can right click on the design surface and select Diagram -> Export as Image and you get the entire edmx model generated as bmp
You can right click on the design surface and select Diagram -> Export as Image and you get the entire edmx model generated as bmp
That is definitely not the case. LINQ-to-Objects is a set of extension methods on IEnumerable<T> that allow you to perform in-memory query operations on arbitrary sequences of objects. The methods accept simple delegates when necessary. LINQ-to-Entities is a LINQ provider that has a set of extension methods on IQueryable<T>. The methods build up an expression … Read more
Simply move the instantiation of the new Product inside the loop. Your code as it is written will add a single instance multiple times which does not produce what you are after…you need a separate instance of each product…the Add method does not make a copy, it attaches the object to the context and marks … Read more
You should be able to use the Null Coalescing operator ??: addresses = (from a in db.ADDRESS where a.CUSTOMER_NUMBER.Equals(customer_number) select new AddressModel { Address_Id = a.ADDRESS_ID, System_Id = a.SYSTEM_ID, Customer_Number = a.CUSTOMER_NUMBER, Address_Type = a.ADDRESS_TYPE, Changed_On = a.CHANGED_ON ?? DateTime.MinValue, Created_On = a.CREATED_ON ?? DateTime.MinValue, Email = a.EMAIL }).ToList();
I faced this problem recently when I upgraded my Web Application from Entity Framework 5 to Entity Framework 6. Then, I realized that System.Data.Entity DLL needs to be removed from the application completely in order to work with Entity Framework 6. Entity Framework 6 is not part of .NET Framework anymore and therefore it is … Read more
Update: If you are using Entity Framework Core you should use the following syntax var hierarchy = from p in ctx.Parents .Include(p => p.Children) .ThenInclude(c => c.GrandChild) select p;
Include demands that the shape of the query doesn’t change. It means that your query must return IQueryable<Match>. GroupBy operator is probably considered as shape changing because it returns IQueryable<IGrouping<TKey, TSource>>. Once the shape of the query changes all Include statements are omitted. Because of that you cannot use Include with projections, custom joins and … Read more
To convert IQuerable or IEnumerable to a list, you can do one of the following: IQueryable<object> q = …; List<object> l = q.ToList(); or: IQueryable<object> q = …; List<object> l = new List<object>(q);
1- Change the GroupDto to be like this: [DataContract] public class GroupDto { [DataMember] public int id { get; set; } [DataMember] public string name{ get; set; } [DataMember] public List<UserDTO> Users { get; set; } } 2- Create your mappings : Mapper.CreateMap<User, UserDto>(); Mapper.CreateMap<UserDto, User>(); // Only if you convert back from dto to … Read more
Deferred execution of LINQ has trapped a lot of people, you’re not alone. The approach I’ve taken to avoiding this problem is as follows: Parameters to methods – use IEnumerable<T> unless there’s a need for a more specific interface. Local variables – usually at the point where I create the LINQ, so I’ll know whether … Read more