public string Shorten(string longLink, Guid?userId, string password) { using (var dc = new LinkKSDataContext()) { var item = new LINK(); item.ID = Guid.NewGuid(); item.LongLink = longLink; item.ShortLink = this.GenerateShortLink(dc); item.UserID = userId; item.Password = password; item.CreatedDate = DateTime.Now; dc.LINKs.InsertOnSubmit(item); dc.SubmitChanges(); return(item.ShortLink); } }
public string Shorten(string longLink, Guid?userId, string password, DateTime?expireDate, bool notification, bool oneshot, byte status) { using (var dc = new LinkKSDataContext()) { var item = new LINK(); item.LINK_ID = Guid.NewGuid(); item.SHORT_LINK = this.GenerateShortLink(dc); item.LONG_LINK = longLink; item.LINK_PASSWORD = password; item.USERID = userId; item.CREATE_DATE = DateTime.Now; item.EXPIRE_DATE = expireDate; item.LINK_NOTIFICATION = notification; item.ONE_SHOT = oneshot; item.LINK_STATUS = status; dc.LINKs.InsertOnSubmit(item); dc.SubmitChanges(); return(item.SHORT_LINK); } }
public string Shorten(string longLink, Guid?userId, string password, DateTime?expireDate, bool oneShot, bool notification) { using (var dc = new LinkKSDataContext()) { var item = new LINK(); //veri tabanında yeni satır oluşturduk item.Id = Guid.NewGuid(); item.LongLink = longLink; item.ShortLink = this.GenerateShortLink(dc); item.UserId = userId; item.Password = password; item.CreateDate = DateTime.Now; item.OneShot = oneShot; item.Notification = notification; dc.LINKs.InsertOnSubmit(item); dc.SubmitChanges(); return(item.ShortLink); } }
private void detach_LINKs(LINK entity) { this.SendPropertyChanging(); entity.USER = null; }
private void attach_LINKs(LINK entity) { this.SendPropertyChanging(); entity.USER = this; }
partial void DeleteLINK(LINK instance);
partial void UpdateLINK(LINK instance);
partial void InsertLINK(LINK instance);