Пример #1
0
        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();
        }
Пример #2
0
 public void DeletePuckRedirect(PuckRedirect pr)
 {
     repo.PuckRedirect.Remove(pr);
 }
Пример #3
0
 public void AddPuckRedirect(PuckRedirect pr)
 {
     repo.PuckRedirect.Add(pr);
 }