Exemplo n.º 1
0
        public async Task <ProgressPoints> CreateNewAsync()
        {
            var newProgressPoint = new ProgressPoints();
            await _context.ProgressPoints.AddAsync(newProgressPoint);

            return(newProgressPoint);
        }
        //User foreign key refernce for linking Users from ProgressPoints
        //public virtual ICollection<ApplicationUser> Users { get; set; }
        //public virtual ICollection<Goals> Goals { get; set; }

        public void Update(ProgressPoints progressPoints)
        {
            progressPoints.Title             = Title;
            progressPoints.Weight            = Weight;
            progressPoints.Description       = Description;
            progressPoints.BMI               = BMI;
            progressPoints.ProgressPointDate = ProgressPointDate;
            progressPoints.Changed           = DateTime.Now;
        }
 public ProgressPointsViewModel(ProgressPoints g)
 {
     Id                     = g.Id;
     Title                  = g.Title;
     Description            = g.Description;
     Weight                 = g.Weight;
     BMI                    = g.BMI;
     this.ProgressPointDate = g.ProgressPointDate;
     Created                = g.Created;
     Changed                = g.Changed;
 }
Exemplo n.º 4
0
 public async Task <int> RemoveProgressPoints(ProgressPoints progressPoint)
 {
     _context.ProgressPoints.Remove(progressPoint);
     return(await SaveChangesAsync());
 }