public async Task <SubscriptionEditor> CreateOrModify(string name, EventNotificationSubscription eventNotificationSubscription, bool isDisabled) { var existing = await repository.FindByName(name).ConfigureAwait(false); if (existing == null) { Instance = await repository.Create(new SubscriptionResource { Name = name, Type = SubscriptionType.Event, IsDisabled = isDisabled, EventNotificationSubscription = eventNotificationSubscription, }) .ConfigureAwait(false); } else { existing.Name = name; existing.IsDisabled = isDisabled; existing.EventNotificationSubscription = eventNotificationSubscription; Instance = await repository.Modify(existing).ConfigureAwait(false); } return(this); }
public SubscriptionEditor CreateOrModify(string name, EventNotificationSubscription eventNotificationSubscription, bool isDisabled) { var existing = repository.FindByName(name); if (existing == null) { Instance = repository.Create(new SubscriptionResource { Name = name, Type = SubscriptionType.Event, IsDisabled = isDisabled, EventNotificationSubscription = eventNotificationSubscription }); } else { existing.Name = name; existing.IsDisabled = isDisabled; existing.EventNotificationSubscription = eventNotificationSubscription; Instance = repository.Modify(existing); } return(this); }
public SubscriptionEditor CreateOrModify(string name, EventNotificationSubscription eventNotificationSubscription, bool isDisabled) { return(new SubscriptionEditor(this).CreateOrModify(name, eventNotificationSubscription, isDisabled)); }
public SubscriptionResource() { EventNotificationSubscription = new EventNotificationSubscription(); }
public SubscriptionResource() { EventNotificationSubscription = new EventNotificationSubscription(); }