public static Dto.Feature ConvertToDto(this Model.Feature feature) { Dto.Feature featureDto = new Dto.Feature { Enabled = feature.Enabled, Id = feature.Id, Module = feature.Module.ConvertToDto(), ModuleId = feature.ModuleId, ModulePrivileges = feature.ModulePrivileges.ForeachToDto(), Name = feature.Name, Privileges = feature.Privileges.ForeachToDto() }; return(featureDto); }
public static Model.Feature ConvertToEntity(this Dto.Feature featureDto, Model.Feature feature = null) { if (feature == null) { feature = new Model.Feature(); } feature.Enabled = featureDto.Enabled; feature.Id = featureDto.Id; feature.Module = featureDto.Module.ConvertToEntity(); feature.ModuleId = featureDto.ModuleId; feature.ModulePrivileges = featureDto.ModulePrivileges.ForeachToEntity(); feature.Name = featureDto.Name; feature.Privileges = featureDto.Privileges.ForeachToEntity(); return(feature); }