Example #1
0
        void CreateAndBroadcastAdvertisement()
        {
            List <Vector2Int> broadcastLocations = GetBroadcastLocations();
            IAdvertisement    advertisement      = Advertisement.Create(advertisingMapElement.Stats, advertisingMapElement.Map, advertisingMapElement.Location, broadcastLocations, advertisingMapElement.GroupId);

            advertisingMapElement.BroadcastAdvertisement(advertisement, excludeReceiver);
        }
Example #2
0
        public Task <Unit> Handle(CreateAdvertisement request, CancellationToken cancellationToken)
        {
            var advertisement = Advertisement.Create(Guid.NewGuid(), request.Name, request.PricePerView);

            _advertisements.Add(advertisement);
            return(Unit.Task);
        }
 // This method gets called by the runtime. Use this method to add services to the container.
 // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
 public void ConfigureServices(IServiceCollection services)
 {
     services.AddSingleton <ICollection <Article> >(p => new List <Article>
     {
         Article.Create(Guid.NewGuid(), "title", "description", "body")
     });
     services.AddSingleton <ICollection <Advertisement> >(p => new List <Advertisement>
     {
         Advertisement.Create(Guid.NewGuid(), "name", 13.4f)
     });
     services.AddMediatR(Assembly.GetExecutingAssembly());
     services.AddControllersWithViews();
     services.AddRazorPages();
 }