Skip to content

Instantly share code, notes, and snippets.

@ahmetkucukoglu
ahmetkucukoglu / CreateEventRequest.cs
Last active February 12, 2020 20:44
ASP.NET Core ile Couchbase GeoSearch - CreateEventRequest.cs
namespace Couchbase.GeoSearchApp
{
using System;
public class CreateEventRequest
{
public string Subject { get; set; }
public DateTimeOffset Date { get; set; }
public string Description { get; set; }
public string Address { get; set; }
@ahmetkucukoglu
ahmetkucukoglu / EventsController.cs
Last active February 12, 2020 20:44
ASP.NET Core ile Couchbase GeoSearch - EventsController.cs
namespace Couchbase.GeoSearchApp.Controllers
{
using Couchbase.Core;
using Couchbase.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Threading.Tasks;
[Route("api/[controller]")]
[ApiController]
@ahmetkucukoglu
ahmetkucukoglu / GetUpcomingEventsRequest.cs
Last active February 12, 2020 20:43
ASP.NET Core ile Couchbase GeoSearch - GetUpcomingEventsRequest.cs
namespace Couchbase.GeoSearchApp
{
public class GetUpcomingEventsRequest
{
public double Latitude { get; set; }
public double Longitude { get; set; }
public string Radius { get; set; }
}
}
@ahmetkucukoglu
ahmetkucukoglu / GetUpcomingEventsResponse.cs
Last active February 12, 2020 20:43
ASP.NET Core ile Couchbase GeoSearch - GetUpcomingEventsResponse.cs
namespace Couchbase.GeoSearchApp
{
using System;
public class GetUpcomingEventsResponse
{
public string Subject { get; set; }
public DateTimeOffset Date { get; set; }
public string Address { get; set; }
}
@ahmetkucukoglu
ahmetkucukoglu / UpcomingEventsController.cs
Last active February 12, 2020 20:43
ASP.NET Core ile Couchbase GeoSearch - UpcomingEventsController.cs
namespace Couchbase.GeoSearchApp.Controllers
{
using Couchbase.Core;
using Couchbase.Extensions.DependencyInjection;
using Couchbase.Search;
using Couchbase.Search.Queries.Geo;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
@ahmetkucukoglu
ahmetkucukoglu / appsettings.json
Last active February 23, 2020 17:19
ASP.NET Core ile Event Sourcing 01 - Store - appsettings.json
{
"EventStore": {
"ConnectionString": "ConnectTo=tcp://admin:changeit@localhost:1113; DefaultUserCredentials=admin:changeit;",
"ConnectionName": "Task"
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
@ahmetkucukoglu
ahmetkucukoglu / Startup.cs
Last active February 23, 2020 17:19
ASP.NET Core ile Event Sourcing 01 - Store - Startup.cs
namespace EventSourcingTaskApp
{
using EventStore.ClientAPI;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
public class Startup
@ahmetkucukoglu
ahmetkucukoglu / Aggregate.cs
Last active February 23, 2020 17:19
ASP.NET Core ile Event Sourcing 01 - Store - Aggregate.cs
namespace EventSourcingTaskApp.Core.Framework
{
using System;
using System.Collections.Generic;
using System.Linq;
public abstract class Aggregate
{
readonly IList<object> _changes = new List<object>();
@ahmetkucukoglu
ahmetkucukoglu / AggregateRepository.cs
Last active February 23, 2020 17:19
ASP.NET Core ile Event Sourcing 01 - Store - AggregateRepository.cs
namespace EventSourcingTaskApp.Infrastructure
{
using EventSourcingTaskApp.Core.Framework;
using EventStore.ClientAPI;
using System;
using System.Linq;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
@ahmetkucukoglu
ahmetkucukoglu / Startup.cs
Last active February 23, 2020 17:18
ASP.NET Core ile Event Sourcing 01 - Store - Startup.cs
namespace EventSourcingTaskApp
{
using EventSourcingTaskApp.Infrastructure;
using EventStore.ClientAPI;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;