public static CoatModel ToModel(this DTOCoat dto) { return(new CoatModel() { Id = dto.Id, Name = dto.Name }); }
public DTOResponse <DTOCoat> Update(DTOCoat updateInfo) { var model = updateInfo.ToModel(); _collection.UpdateOne <CoatModel>(coat => coat.Id == updateInfo.Id, Builders <CoatModel> .Update.Set("Name", updateInfo.Name)); return(new DTOResponse <DTOCoat>() { Code = 200 }); }
public DTOResponse <DTOCoat> Create(DTOCoat createInfo) { var model = createInfo.ToModel(); _collection.InsertOne(model); return(new DTOResponse <DTOCoat>() { Code = 200 }); }
public DTOResponse <bool> Delete(DTOCoat deleteCoatByIdInfo) { return(_coatDomain.DeleteById(deleteCoatByIdInfo.Id)); }
public DTOResponse <DTOCoat> Update(DTOCoat updateCoatInfo) { return(_coatDomain.Update(updateCoatInfo)); }
public DTOResponse <DTOCoat> GetById(DTOCoat getCoatByIdInfo) { return(_coatDomain.GetById(getCoatByIdInfo.Id)); }
public DTOResponse <DTOCoat> Create(DTOCoat createCoatInfo) { return(_coatDomain.Create(createCoatInfo)); }