// Need to override for composite keys public override int GetHashCode() { if (SeqNum == 0) { return(base.GetHashCode()); //transient instance } return(CreatedOn.GetHashCode() ^ SeqNum.GetHashCode()); }
public Quotation() { Products = new HashedSet <ProductQuotation>(); AgentPercentage = 1; CompanyPercentage = 1; CreatedOn = DateTime.Now; ValidUntil = CreatedOn.AddMonths(1); }
/// <summary> /// Получить критерии для поиска /// </summary> /// <returns></returns> public IEnumerable <SearchQueryCriteria <UserNotificationInteraction> > GetCriterias() { yield return(Read.MapNullable(value => new SearchQueryCriteria <UserNotificationInteraction>(x => x.ReadOn.HasValue == value))); yield return(CreatedOn.GetSearchCriteriaFromGenericRange <UserNotificationInteraction, DateTime>(x => x.CreatedOn)); yield return(UserId.MapString(str => new SearchQueryCriteria <UserNotificationInteraction>(x => x.UserId == str))); }
public void ListEmployees(Company name) { Console.WriteLine($"{name.Name} established: {CreatedOn.ToString("MM/dd/yyyy")}"); foreach (Employee employee in name.employeeList) { Console.WriteLine($"{employee.FirstName} {employee.LastName} - {employee.Title}"); } }
private bool Equals(RocketMessage other) { return(string.Equals(Id, other.Id) && string.Equals(RoomId, other.RoomId) && string.Equals(Message, other.Message) && IsBot == other.IsBot && Equals(CreatedBy, other.CreatedBy) && CreatedOn.Equals(other.CreatedOn) && Equals(EditedBy, other.EditedBy) && EditedOn.Equals(other.EditedOn) && IsBotMentioned == other.IsBotMentioned && IsFromMyself == other.IsFromMyself && string.Equals(Type, other.Type) && Mentions.Equals(other.Mentions) && Starred.Equals(other.Starred)); }
public virtual void Edit(string description, User assignedTo, TaskType type, User currentUser) { Description = description; AssignedTo = assignedTo; Type = type; DueDate = CreatedOn.AddMinutes(type.ServiceLevelAgreementMinutes); LastModifiedBy = currentUser; LastModifiedOn = DateTime.Now; }
public void ShouldBe(Order other) { Id.ShouldBe(other.Id); PersonId.ShouldBe(other.PersonId); PoNumber.ShouldBe(other.PoNumber); Status.ShouldBe(other.Status); CreatedOn.ShouldBe(other.CreatedOn); CreatedBy.ShouldBe(other.CreatedBy); }
public override void Handle(ServiceLocator locator) { var products = locator.Get <List <Product> >(); var existing = products.First(it => it.HasName(name)); existing.Buy(qty); Console.WriteLine("[{0}] Added qty {1} to product {2}.", CreatedOn.ToString("yyyy-MM-dd HH:mm:ss"), qty, name); }
public override int GetHashCode() { int result = 1; result = (result * 397) ^ (About != null ? About.GetHashCode() : 0); result = (result * 397) ^ (CreatedOn != null ? CreatedOn.GetHashCode() : 0); result = (result * 397) ^ Id.GetHashCode(); result = (result * 397) ^ (ResearchInterests != null ? ResearchInterests.GetHashCode() : 0); return(result); }
private string _DisplayName() { string FirstWagon, CreatedTime; FirstWagon = Wagons[0]?.ID; if (Wagons.Count>0) FirstWagon += string.Format(" and {0} others.",Wagons.Count-1) ; CreatedTime = CreatedOn.ToShortTimeString(); return string.Format("{0} : {1} - {2}", Status.ToString(), CreatedTime, FirstWagon); }
public override string ToString() { return($"Id={Id}" + Environment.NewLine + $"Title={Title}" + Environment.NewLine + $"Message={Message}" + Environment.NewLine + $"To WHo={ToWho}" + Environment.NewLine + $"Created By={CreatedBy.Id} - {CreatedBy.Name} - {CreatedBy.Account}" + Environment.NewLine + $"Created On={CreatedOn.ToString("yyyy/MM/dd H:mm:ss")}" + Environment.NewLine + $"Last Updated On={LastUpdatedOn.ToString("yyyy/MM/dd H:mm:ss")}" + Environment.NewLine); }
public StringBuilder GetSignData() { StringBuilder sb = new StringBuilder(); sb.Append(nameof(Id)).Append(Id) .Append(nameof(Name)).Append(Name) .Append(nameof(Description)).Append(Description) .Append(nameof(CreatedOn)).Append(CreatedOn.ToUlong()) .Append(nameof(ModifiedOn)).Append(ModifiedOn.ToUlong()); return(sb); }
protected override void OnParametersSet() { _text = string.Empty; if (!String.IsNullOrEmpty(CreatedBy) || CreatedOn != null) { _text += "<p style=\"" + Style + "\">Created "; if (!String.IsNullOrEmpty(CreatedBy)) { _text += " by <b>" + CreatedBy + "</b>"; } if (CreatedOn != null) { _text += " on <b>" + CreatedOn.ToString("MMM dd yyyy HH:mm:ss") + "</b>"; } _text += "</p>"; } if (!String.IsNullOrEmpty(ModifiedBy) || ModifiedOn != null) { _text += "<p style=\"" + Style + "\">Last modified "; if (!String.IsNullOrEmpty(ModifiedBy)) { _text += " by <b>" + ModifiedBy + "</b>"; } if (ModifiedOn != null) { _text += " on <b>" + ModifiedOn.ToString("MMM dd yyyy HH:mm:ss") + "</b>"; } _text += "</p>"; } if (!String.IsNullOrEmpty(DeletedBy) || DeletedOn.HasValue) { _text += "<p style=\"" + Style + "\">Deleted "; if (!String.IsNullOrEmpty(DeletedBy)) { _text += " by <b>" + DeletedBy + "</b>"; } if (DeletedOn != null) { _text += " on <b>" + DeletedOn.Value.ToString("MMM dd yyyy HH:mm:ss") + "</b>"; } _text += "</p>"; } }
public override int GetHashCode() { int result = 1; result = (result * 397) ^ (ApplicationNumber != null ? ApplicationNumber.GetHashCode() : 0); result = (result * 397) ^ CreatedOn.GetHashCode(); result = (result * 397) ^ Id.GetHashCode(); result = (result * 397) ^ (SignitureName != null ? SignitureName.GetHashCode() : 0); result = (result * 397) ^ (UnderGradEntryKind != null ? UnderGradEntryKind.GetHashCode() : 0); return(result); }
public override int GetHashCode() { int result = 1; result = (result * 397) ^ (Code != null ? Code.GetHashCode() : 0); result = (result * 397) ^ (CreatedOn != null ? CreatedOn.GetHashCode() : 0); result = (result * 397) ^ Id.GetHashCode(); result = (result * 397) ^ (LastModified != null ? LastModified.GetHashCode() : 0); result = (result * 397) ^ (Name != null ? Name.GetHashCode() : 0); return(result); }
public void CreateCreatedOnShouldSucceed() { // Arrange var date = DateTime.UtcNow; // Act var newDate = new CreatedOn(date); // Assert newDate.Should().NotBeNull(); }
public override int GetHashCode() { int result = 1; result = (result * 397) ^ Category.GetHashCode(); result = (result * 397) ^ CreatedOn.GetHashCode(); result = (result * 397) ^ Id.GetHashCode(); result = (result * 397) ^ (Information != null ? Information.GetHashCode() : 0); result = (result * 397) ^ (UserDescription != null ? UserDescription.GetHashCode() : 0); result = (result * 397) ^ (Username != null ? Username.GetHashCode() : 0); return(result); }
public override bool Equals(object obj) { return(obj is Block item && Hash.Equals(item.Hash) && Index.Equals(item.Index) && Difficulty.Equals(item.Difficulty) && PreviousBlockHash.Equals(item.PreviousBlockHash) && MinedBy.Equals(item.MinedBy) && Nonce.Equals(item.Nonce) && CreatedOn.Equals(item.CreatedOn) && Transactions.SequenceEqual(item.Transactions)); }
// Autogenerated by ReSharper public bool Equals(Person other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(Id == other.Id && Name == other.Name && CreatedOn.Equals(other.CreatedOn) && IsActive == other.IsActive); }
public override int GetHashCode() { int hashCode = -2056286480; hashCode = hashCode * -1521134295 + ID.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Name); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Detail); hashCode = hashCode * -1521134295 + CreatedOn.GetHashCode(); return(hashCode); }
public override int GetHashCode() { int result = 1; result = (result * 397) ^ (CreatedOn != null ? CreatedOn.GetHashCode() : 0); result = (result * 397) ^ (Description != null ? Description.GetHashCode() : 0); result = (result * 397) ^ Id.GetHashCode(); result = (result * 397) ^ (LogoPathName != null ? LogoPathName.GetHashCode() : 0); result = (result * 397) ^ (Name != null ? Name.GetHashCode() : 0); result = (result * 397) ^ (ShortName != null ? ShortName.GetHashCode() : 0); return(result); }
public string GetSignData() { StringBuilder sb = new StringBuilder(); sb.Append(nameof(CoinCode)).Append(CoinCode) .Append(nameof(Speed)).Append(Speed) .Append(nameof(SpeedUnit)).Append(SpeedUnit) .Append(nameof(IncomePerDay)).Append(IncomePerDay) .Append(nameof(CreatedOn)).Append(CreatedOn.ToUlong()) .Append(nameof(ModifiedOn)).Append(ModifiedOn.ToUlong()); return(sb.ToString()); }
public string GetSignData() { StringBuilder sb = new StringBuilder(); sb.Append(nameof(Id)).Append(Id) .Append(nameof(FileName)).Append(FileName) .Append(nameof(Version)).Append(Version) .Append(nameof(VersionTag)).Append(VersionTag) .Append(nameof(CreatedOn)).Append(CreatedOn.ToUlong()) .Append(nameof(PublishOn)).Append(PublishOn.ToUlong()); return(sb.ToString()); }
public void OperatorToDateTimeShouldSucceed() { // Arrange var value = DateTime.Now.ToUniversalTime(); var createdOn = new CreatedOn(value); // Act DateTime result = createdOn; // Assert result.Should().Be(value); }
public override int GetHashCode() { int result = 1; result = (result * 397) ^ (Content != null ? Content.GetHashCode() : 0); result = (result * 397) ^ CreatedOn.GetHashCode(); result = (result * 397) ^ (DefaultImageFilelName != null ? DefaultImageFilelName.GetHashCode() : 0); result = (result * 397) ^ Id.GetHashCode(); result = (result * 397) ^ (ShortDescription != null ? ShortDescription.GetHashCode() : 0); result = (result * 397) ^ (Title != null ? Title.GetHashCode() : 0); return(result); }
/// <inheritdoc /> public bool Equals(Expectation other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(Id == other.Id && CreatedOn.Equals(other.CreatedOn) && ModifiedOn.Equals(other.ModifiedOn) && Equals(Timestamp, other.Timestamp) && Equals(HttpRequest, other.HttpRequest) && Equals(HttpResponse, other.HttpResponse) && Equals(HttpResponseTemplate, other.HttpResponseTemplate) && Equals(HttpForward, other.HttpForward) && Equals(HttpForwardTemplate, other.HttpForwardTemplate) && Equals(HttpError, other.HttpError) && Equals(Times, other.Times) && Equals(TimeToLive, other.TimeToLive)); }
public string[] ToJQueryDataTableResult() { return(new[] { ForecastId.ToString(), CreatedOn.ToString("dd/MM/yyyy HH:mm"), CreatedBy, CarLine, ModelYear, Gateway }); }
public override int GetHashCode() { int hashCode = -1422345826; hashCode = hashCode * -1521134295 + ID.GetHashCode(); hashCode = hashCode * -1521134295 + ProjectID.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Detail); hashCode = hashCode * -1521134295 + Status.GetHashCode(); hashCode = hashCode * -1521134295 + AssignedToUserID.GetHashCode(); hashCode = hashCode * -1521134295 + CreatedOn.GetHashCode(); return(hashCode); }
public new string[] ToJQueryDataTableResult() { return(new[] { FdpMarketMappingId.GetValueOrDefault().ToString(), CreatedOn.GetValueOrDefault().ToString("dd/MM/yyyy"), CreatedBy, Programme.GetDisplayString(), Gateway, ImportMarket, Name }); }
public virtual string[] ToJQueryDataTableResult() { return(new[] { FdpImportErrorExclusionId.GetValueOrDefault().ToString(), CreatedOn.GetValueOrDefault().ToString("dd/MM/yyyy"), CreatedBy, TypeDescription, SubTypeDescription, Document.Name, ErrorMessage }); }