コード例 #1
0
        public Advisor Update(Advisor advisor)
        {
            var AdvisorData = context.Advisors.Attach(advisor);

            AdvisorData.State = Microsoft.EntityFrameworkCore.EntityState.Modified;
            context.SaveChanges();
            return(advisor);
        }
コード例 #2
0
        public Advisor Delete(int id)
        {
            Advisor advisor = context.Advisors.Find(id);

            if (advisor != null)
            {
                context.Advisors.Remove(advisor);
                context.SaveChanges();
            }

            return(advisor);
        }
コード例 #3
0
 public Advisor Add(Advisor advisor)
 {
     context.Advisors.Add(advisor);
     context.SaveChanges();
     return(advisor);
 }