У меня есть следующая модель:
public class Customer
{
public int Id {get; set;}
public string Name {get; set;}
public int AddressId {get; set;}
public virtual Address Address {get; set;}
public virtual ICollection<CustomerCategory> Categories {get; set;}
}
public class CustomerCategory
{
public int Id {get; set;}
public int CustomerId {get; set;}
public int CategoryId {get; set;}
public virtual Category Category {get; set;}
}
public class Address
{
public int Id {get; set;}
public string Street{get; set;}
public virtual PostCode PostCode {get; set;}
}
Исходя из вышеизложенного и используя GraphDiff, я хочу обновить совокупность клиентов следующим образом:
dbContext.UpdateGraph<Customer>(entity,
map => map.AssociatedEntity(x => x.Address)
.OwnedCollection(x => x.Categories, with => with.AssociatedEntity(x => x.Category)));
Но вышеизложенное ничего не обновляет!!
Как правильно использовать GraphDiff в этом случае?
EntityGraphOperations
. Это очень простой в использовании. И автоматически определяет состояния всех сущностей и использует свободный синтаксис. - person Farhad Jabiyev   schedule 14.09.2016