public static TabaccoDTO ToDto(this Tabacco tabacco) { return(new TabaccoDTO { Id = tabacco.Id, InternalId = tabacco.InternalId, Name = tabacco.Name, Type = tabacco.Type, Picture = tabacco.Picture, Power = tabacco.Power, CreatedAt = ((long)(tabacco.CreatedAt - new DateTime(1970, 1, 1)).TotalMilliseconds).ToString(), CreatedBy = tabacco.CreatedBy, LastModifiedAt = ((long)(tabacco.CreatedAt - new DateTime(1970, 1, 1)).TotalMilliseconds).ToString(), LastModifiedBy = tabacco.LastModifiedBy }); }
public async Task <Tabacco> Add(Tabacco tabacco) { var result = await tabaccoRepository.AddOne(tabacco); return(tabacco); }