public void AddEthnic(Ethnic ethnic) { context.Ethnics.Add(ethnic); SetAuditFields(ethnic); context.SaveChanges(); }
public ActionResult Create(CreateEditViewModel model) { var ethnic = new Ethnic(); Mapper.DynamicMap(model, ethnic); ethnicProvider.AddEthnic(ethnic); var jsonViewModel = new AjaxViewModel(true, model, null); return(Json(jsonViewModel)); }
public async Task <Ethnic> Get(long Id) { Ethnic Ethnic = await context.Ethnic.Where(d => d.Id == Id).Select(d => new Ethnic { Id = d.Id, Code = d.Code, Name = d.Name, }).FirstOrDefaultAsync(); return(Ethnic); }
public async Task <Ethnic> Get(Guid Id) { Ethnic Ethnic = await tFContext.Ethnic.Where(d => d.Id.Equals(Id)).Select(d => new Ethnic { Id = d.Id, Code = d.Code, Name = d.Name, }).FirstOrDefaultAsync(); return(Ethnic); }
public async Task <EthnicDTO> GetEthnic([FromBody] EthnicDTO ethnicDTO) { if (ethnicDTO == null) { ethnicDTO = new EthnicDTO(); } var ethnic = new Ethnic { Id = ethnicDTO.Id }; ethnic = await EthnicService.Get(ethnic.Id); return(ethnic == null ? null : new EthnicDTO { Id = ethnic.Id, Code = ethnic.Code, Name = ethnic.Name }); }
public void UpdateEthnic(Ethnic ethnic) { SetAuditFields(ethnic); context.SaveChanges(); }