private void SaveOld() { using (ItsEntities Context = new ItsEntities()) { Issues DBIssue = Context.Issues.Where(p => p.IssueId == IssueId).FirstOrDefault(); if (DBIssue == null) return; DBIssue.Subject = Subject; DBIssue.Description = Description; Context.SaveChanges(); } }
public static List<Issue> GetIssues() { List<Issue> Result = new List<Issue>(); using (ItsEntities Context = new ItsEntities()) { foreach (var DBIssue in Context.Issues) { Result.Add(new Issue().ConvertFromEntity(DBIssue)); } } return Result; }
private void SaveNew() { using (ItsEntities Context = new ItsEntities()) { Issues DBIssue = new Issues() { Subject = Subject, Description = Description }; Context.Issues.Add(DBIssue); Context.SaveChanges(); IssueId = DBIssue.IssueId; } }