/// <summary> /// Creates a new <see cref="ResourceEventDefinition{TResource, TDomain}" /> with a change type /// of <see cref="ResourceEventChangeType.Deleted" /> and an event sub id of <c>deleted</c>. /// </summary> /// <returns>A new resource event definition.</returns> public ResourceEventDefinition <TResource> Deleted() { return(new ResourceEventDefinition <TResource>( ResourceEventChangeType.Deleted, ResourceEvent <TResource> .CreateId("deleted"), this._mapper)); }
/// <summary> /// Creates a new <see cref="ResourceEventDefinition{TResource, TDomain}" /> with a change type /// of <see cref="ResourceEventChangeType.Updated" /> and the given event sub id. /// </summary> /// <param name="eventSubId">The "sub" ID, unique within a resource's event namespace.</param> /// <returns>A new resource event definition.</returns> public ResourceEventDefinition <TResource> Updated(string eventSubId) { return(new ResourceEventDefinition <TResource>( ResourceEventChangeType.Updated, ResourceEvent <TResource> .CreateId(eventSubId), this._mapper)); }
public override void Write(Utf8JsonWriter writer, ResourceEvent <T> value, JsonSerializerOptions options) { writer.WriteStartObject(); writer.WriteString(_object, value.Object); writer.WriteString(_eventId, value.EventId); writer.WriteString(_changeType, value.ChangeType.ToString()); writer.WriteString(_created, value.Created); writer.WriteString(_resourceObject, value.ResourceObject); if (value.Href != null) { writer.WriteString(_href, value.Href); } if (value.CorrelationId != null) { writer.WritePropertyName(_correlationId); JsonSerializer.Serialize(writer, value.CorrelationId, options); } if (value.Data != null) { writer.WritePropertyName(_data); JsonSerializer.Serialize(writer, value.Data, options); } if (value.ChangedValues != null) { writer.WritePropertyName(_changedValues); JsonSerializer.Serialize(writer, value.ChangedValues, options); } if (value.Metadata != null) { writer.WritePropertyName(_metadata); JsonSerializer.Serialize(writer, value.Metadata, options); } if (value.SecureData != null) { writer.WritePropertyName(_secureData); JsonSerializer.Serialize(writer, value.SecureData, options); } writer.WriteEndObject(); }
public Task AddAsync(ResourceEvent resourceEvent) { return(Task.CompletedTask); }
private static void ReadValue(ref Utf8JsonReader reader, ResourceEvent <T> value, JsonSerializerOptions options) { if (TryReadStringProperty(ref reader, _eventId, out var propertyValue)) { value.EventId = propertyValue; }
/// <summary> /// Creates a new <see cref="ResourceEventDefinitionWithMapper{TResource, TDomain}" /> with a change type /// of <see cref="ResourceEventChangeType.Deleted" /> and the given event sub id. /// </summary> /// <param name="eventSubId">The "sub" ID, unique within a resource's event namespace.</param> /// <returns>A new resource event definition.</returns> public TReturn Deleted(string eventSubId) { return(this.Create( ResourceEventChangeType.Deleted, ResourceEvent <TResource> .CreateId(eventSubId))); }
/// <summary> /// Creates a new <see cref="ResourceEventDefinitionWithMapper{TResource, TDomain}" /> with a change type /// of <see cref="ResourceEventChangeType.Deleted" /> and an event sub id of <c>deleted</c>. /// </summary> /// <returns>A new resource event definition.</returns> public TReturn Deleted() { return(this.Create( ResourceEventChangeType.Deleted, ResourceEvent <TResource> .CreateId("deleted"))); }
/// <summary> /// Creates a new <see cref="ResourceEventDefinitionWithMapper{TResource, TDomain}" /> with a change type /// of <see cref="ResourceEventChangeType.Updated" /> and an event sub id of <c>updated</c>. /// </summary> /// <returns>A new resource event definition.</returns> public TReturn Updated() { return(this.Create( ResourceEventChangeType.Updated, ResourceEvent <TResource> .CreateId("updated"))); }