BolfTracker.Infrastructure.EntityFramework.ShotRepository.Add C# (CSharp) 메소드

Add() 공개 메소드

public Add ( BolfTracker.Models.Shot shot ) : void
shot BolfTracker.Models.Shot
리턴 void
        public void Add(Shot shot)
        {
            using (var context = new BolfTrackerContext())
            {
                context.Shots.Attach(shot);
                context.Entry(shot).State = EntityState.Added;
                context.SaveChanges();
            }
        }