public void AddRedirect(string from, string to, string type) { if (string.IsNullOrEmpty(from) || string.IsNullOrEmpty(to) || string.IsNullOrEmpty(type)) { return; } from = from.Trim().ToLower(); to = to.Trim().ToLower(); type = type.Trim(); var redirect = repo.GetPuckRedirect().FirstOrDefault(x => x.From.Equals(from)); if (redirect == null) { redirect = new PuckRedirect() { From = from }; repo.AddPuckRedirect(redirect); } redirect.To = to; redirect.Type = type; repo.SaveChanges(); }
public void DeletePuckRedirect(PuckRedirect pr) { repo.PuckRedirect.Remove(pr); }
public void AddPuckRedirect(PuckRedirect pr) { repo.PuckRedirect.Add(pr); }