forked from MDCPS/DamageAssessment_Backend
conflict resolution
This commit is contained in:
@ -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();
|
||||
|
@ -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");
|
||||
}
|
||||
|
Reference in New Issue
Block a user