Пример #1
0
 /// <summary>
 /// Deletes a short URL from the data context.
 /// </summary>
 /// <param name="shortUrl">The short URL to be deleted.</param>
 public void DeleteShortUrl(ShortURL shortUrl)
 {
     _entityContainer.ShortURLs.Remove(shortUrl);
     _entityContainer.SaveChanges();
 }
Пример #2
0
 /// <summary>
 /// Adds a short URL to the data context.
 /// </summary>
 /// <param name="shortUrl">The short URL to be added.</param>
 public void AddShortUrl(ShortURL shortUrl)
 {
     _entityContainer.ShortURLs.Add(shortUrl);
     _entityContainer.SaveChanges();
 }