working customer post, get and delete
This commit is contained in:
@@ -4,11 +4,23 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AB.Domain.Entities
|
||||
{
|
||||
public class Customer
|
||||
{
|
||||
Guid coutomerId;
|
||||
namespace AB.Domain.Entities;
|
||||
|
||||
public class Customer
|
||||
{
|
||||
|
||||
public Guid CustomerId { get; set; }
|
||||
|
||||
public string Salutation { get; set; }
|
||||
|
||||
public string Name1 { get; set; }
|
||||
|
||||
public string Name2 { get; set; }
|
||||
|
||||
public string Email { get; set; }
|
||||
|
||||
public string Iban { get; set; }
|
||||
|
||||
public string PhoneNumber { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,11 +4,10 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AB.Domain.Entities
|
||||
{
|
||||
public class Product
|
||||
{
|
||||
Guid productId;
|
||||
namespace AB.Domain.Entities;
|
||||
|
||||
public class Product
|
||||
{
|
||||
public Guid ProductId { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,11 +4,10 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AB.Domain.Entities
|
||||
{
|
||||
public class Supplier
|
||||
{
|
||||
namespace AB.Domain.Entities;
|
||||
|
||||
Guid supplierId;
|
||||
}
|
||||
public class Supplier
|
||||
{
|
||||
|
||||
public Guid SupplierId { get; set; }
|
||||
}
|
||||
|
||||
@@ -4,14 +4,13 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AB.Domain.Exceptions
|
||||
namespace AB.Domain.Exceptions;
|
||||
|
||||
public class BusinessPartnerNotFoundException : NotFoundException
|
||||
{
|
||||
public class BusinessPartnerNotFoundException : NotFoundException
|
||||
{
|
||||
|
||||
public BusinessPartnerNotFoundException(Guid businessPartnerId)
|
||||
: base ($"The BusinessPartner with the indetifier {businessPartnerId} was not found.")
|
||||
{ }
|
||||
public BusinessPartnerNotFoundException(Guid businessPartnerId)
|
||||
: base ($"The BusinessPartner with the indetifier {businessPartnerId} was not found.")
|
||||
{ }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,17 +4,16 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AB.Domain.Exceptions
|
||||
{
|
||||
namespace AB.Domain.Exceptions;
|
||||
|
||||
[Serializable]
|
||||
public abstract class NotFoundException : Exception
|
||||
{
|
||||
public NotFoundException() { }
|
||||
public NotFoundException(string message) : base(message) { }
|
||||
public NotFoundException(string message, Exception inner) : base(message, inner) { }
|
||||
protected NotFoundException(
|
||||
System.Runtime.Serialization.SerializationInfo info,
|
||||
System.Runtime.Serialization.StreamingContext context) : base(info, context) { }
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public abstract class NotFoundException : Exception
|
||||
{
|
||||
public NotFoundException() { }
|
||||
public NotFoundException(string message) : base(message) { }
|
||||
public NotFoundException(string message, Exception inner) : base(message, inner) { }
|
||||
protected NotFoundException(
|
||||
System.Runtime.Serialization.SerializationInfo info,
|
||||
System.Runtime.Serialization.StreamingContext context) : base(info, context) { }
|
||||
}
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
using System;
|
||||
using AB.Domain.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AB.Domain.Repositories
|
||||
namespace AB.Domain.Repositories;
|
||||
|
||||
public interface ICustomerRepository
|
||||
{
|
||||
public class ICustomerRepository
|
||||
{
|
||||
}
|
||||
public Task<IEnumerable<Customer>> GetAllAsync(CancellationToken cancellationToken);
|
||||
Task<Customer> GetByIdAsync(Guid customerId, CancellationToken cancellationToken);
|
||||
void Insert(Customer customer);
|
||||
void Remove(Customer customer);
|
||||
}
|
||||
|
||||
@@ -4,9 +4,8 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AB.Domain.Repositories
|
||||
namespace AB.Domain.Repositories;
|
||||
|
||||
public class ISupplierRepository
|
||||
{
|
||||
public class ISupplierRepository
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace AB.Domain.Repositories;
|
||||
|
||||
namespace AB.Domain.Repositories
|
||||
public interface IUnitOfWork
|
||||
{
|
||||
public class IUnitOfWork
|
||||
{
|
||||
}
|
||||
public Task<int> SaveChangesAsync(CancellationToken cancellationToken);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user