Ejemplo n.º 1
0
        // TODO: Delete
        public static async Task <Producer> SetOrGetExistingAsync(this IProducerRepository repository, string name)
        {
            var @producer = await repository.GetAsync(name);

            if (@producer == null)
            {
                var id = Guid.NewGuid();
                @producer = new Producer(id, name);
                await repository.AddAsync(@producer);
            }

            return(@producer);
        }