conflict resolution

This commit is contained in:
Reginald Cherenfant Jasmin
2023-12-07 01:45:26 -05:00
29 changed files with 613 additions and 62 deletions

View File

@ -6,12 +6,18 @@ using System.Reflection;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
// CORS setup to allow requests from any origin.
builder.Services.AddCors(p => p.AddPolicy("DamageAppCorsPolicy", build => {
build.WithOrigins("*").AllowAnyMethod().AllowAnyHeader().AllowAnyOrigin();
}));
// Add services to the container.
builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
//builder.Services.AddSwaggerGen();
// Add Swagger/OpenAPI documentation support.
builder.Services.AddSwaggerGen(c =>
{
// Include XML comments from your assembly
@ -44,7 +50,14 @@ if (app.Environment.IsDevelopment())
employeesProvider.SeedData();
}
}
<<<<<<< HEAD
app.UseCors("DamageAppCorsPolicy");
=======
// Enable CORS, authentication, and authorization middleware.
app.UseCors("DamageAppCorsPolicy");
>>>>>>> 9ec9b8b96fc7c5767fcddf1e4e52bde203fcf619
app.UseAuthorization();
app.MapControllers();

View File

@ -77,7 +77,8 @@ namespace DamageAssesment.Api.Employees.Providers
EmployeeDbContext.Employees.Add(_employee);
Employee.Id = _employee.Id;
EmployeeDbContext.SaveChanges();
return (true, Employee, null);
//return (true, Employee, null);
return (true, mapper.Map<Db.Employee, Models.Employee>(_employee), null);
}
return (false, null, "Employee code is already exits");
}