public TypeContribution Insert(TypeContribution typeContribution)
        {
            _db.TypeContributions.Add(typeContribution);
            _db.SaveChanges();

            return typeContribution;
        }
        public TypeContribution Edit(TypeContribution typeContribution)
        {
            _db.Entry(typeContribution).State = EntityState.Modified;
            _db.SaveChanges();

            return typeContribution;
        }
 public static TypeContributionDTO TypeContributionToDto(TypeContribution typeContribution)
 {
     return new TypeContributionDTO
     {
         TypeContributionId = typeContribution.TypeContributionId,
         Name = typeContribution.Name,
     };
 }
 public void Remove(TypeContribution typeContribution)
 {
     _db.Entry(typeContribution).State = EntityState.Deleted;
     _db.SaveChanges();
 }
Exemple #5
0
 public static Contribution Create(Member member, DateTime contributionDate, double value, TypeContribution typeContribution)
 => new Contribution()
 {
     Member           = member,
     DeliveryDate     = contributionDate,
     Value            = value,
     TypeContribution = typeContribution
 };