Exemple #1
0
 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
     });
 }
Exemple #2
0
        public async Task <Tabacco> Add(Tabacco tabacco)
        {
            var result = await tabaccoRepository.AddOne(tabacco);

            return(tabacco);
        }