void ICustodiansRepository.UpdateCustodian(Custodian custodian) { using (var dc = CreateContext()) { var entity = GetCommunityAdministratorEntity(dc, custodian.Id); if (entity != null) { custodian.MapTo(entity); dc.SubmitChanges(); } } }
public static CommunityAdministratorEntity Map(this Custodian custodian) { var entity = new CommunityAdministratorEntity { id = custodian.Id, RegisteredUserEntity = new RegisteredUserEntity { id = custodian.Id }, }; custodian.MapTo(entity); return(entity); }
public static void MapTo(this Custodian custodian, CommunityAdministratorEntity entity) { custodian.MapTo(entity.RegisteredUserEntity); custodian.MapTo((IHaveEmailAddressEntity)entity.RegisteredUserEntity); }