/// <summary> /// Sets the RowKey in the format (REVERSETICKS_AUTHOROID_TITLE). /// </summary> /// <param name="authorOID">The oid of the author (GUID of the user object), to be saved in RowKey.</param> /// <param name="title">The title to be saved in RowKey.</param> private void SetRowKey(string authorOID, string title) { RowKey = string.Format("{0}_{1}_{2}", RowKey?.Substring(0, 19) ?? (DateTime.MaxValue.Ticks - DateTime.UtcNow.Ticks).ToString("d19"), RowKey?.Substring(20, 36) ?? authorOID, title); }
private void ConfigureKeys() { if (string.IsNullOrWhiteSpace(RowKey)) { throw new System.Exception($"User requires a name."); } PartitionKey = RowKey.Substring(0, 1).ToUpperInvariant(); }
public string GetConversationId() { if (RowKey.Length < ConversationIdPrefix.Length) { throw new ArgumentException($"Invalid row key for conversation Id {RowKey}"); } return(RowKey.Substring(ConversationIdPrefix.Length)); }
public Model.Site.MonthIndex GetSiteEntity() { return(new Model.Site.MonthIndex { FirstPostId = this.FirstPostId, MonthsPosts = this.MonthsPosts, YearMonth = this.RowKey.Substring(0, 4) + "-" + RowKey.Substring(4, 2) }); }
public BuyerRequestModel(string companyID, string title, string category, string description, int quantity, DateTime dateExpire, string photoUrl) { DatePosted = DateTime.UtcNow; RowKey = Guid.NewGuid().ToString(); CompanyID = companyID; RequestTitle = title; Category = category; RequestDescription = description; Quantity = quantity; DateExpire = dateExpire; PhotoUrl = photoUrl; PartitionKey = RowKey.Substring(0, 1); }
public ProductModel(string name, string description, string photourl, string companyid) { RowKey = Guid.NewGuid().ToString(); ProductName = name; Description = description; PhotoUrl = photourl; IsApproved = false; CompanyID = companyid; BrandName = string.Empty; PartitionKey = RowKey.Substring(0, 1); FeaturedProductWeight = 0; }