Esempio n. 1
0
        public TDataObject Create(TDataObject obj)
        {
            var entity = SFactory.SingleMappingObjectToEntity(obj);

            entity.Id          = Guid.NewGuid();
            entity.CreatedDate = DateTime.Now;
            Repository.Insert(entity: entity);
            var _resp = SFactory.SingleMappingEntityToObject(entity);

            return(_resp);
        }
Esempio n. 2
0
 public Task <TDataObject> CreateAsync(TDataObject obj)
 {
     return(Task.Run(() =>
     {
         var entity = SFactory.SingleMappingObjectToEntity(obj);
         entity.Id = Guid.NewGuid();
         TEntity result = Repository.Insert(entity: entity);
         var _resp = SFactory.SingleMappingEntityToObject(result);
         return _resp;
     }));
 }