Beispiel #1
0
        public Paste CreatePaste(string title,
            string description,
            PasteType type,
            int languageId,
            string createdById)
        {
            var newPaste = new Paste
            {
                Title = title,
                Description = description,
                Type = type,
                LanguageId = languageId,
                CreatedOn = DateTime.UtcNow,
                CreatedById = createdById
            };

            this.pastes.Add(newPaste);
            this.pastes.SaveChanges();

            return newPaste;
        }
Beispiel #2
0
 public void Update(Paste paste)
 {
     this.pastes.Update(paste);
     this.pastes.SaveChanges();
 }