Thankyou, for your help. I have found out the error, your post gave me the idea, a field in the Prospectus was a different type to the one in Students :-)
In the MapperProfile I created the map `//map the prospectus to the student
CreateMap<ProspectusCreateDto, Student>().IgnoreFullAuditedObjectProperties().Ignore(x => x.ExtraProperties).Ignore(x => x.ConcurrencyStamp).Ignore(x => x.Id).Ignore(x => x.TenantId);`
In my ProspectusAppService class I modified the Create method
public virtual async Task<ProspectusDto> CreateAsync(ProspectusCreateDto input)
{
var prospectus = ObjectMapper.Map<ProspectusCreateDto, Prospectus>(input);
prospectus.TenantId = CurrentTenant.Id;
//get the Position role from the position Id
var SelectedPosition = _positionRepository.AsQueryable()
.Where(p => p.Id == prospectus.PositionId)
.Select(p => new { Role = p.Role, Id = p.Id }).FirstOrDefault();
if (SelectedPosition.Role == "Student") //student
{
var student = ObjectMapper.Map<ProspectusCreateDto, Student>(input);
student.TenantId = CurrentTenant.Id;
//save it to the student table
await _studentRepository.InsertAsync(student, autoSave: true);
//delete it from the prospectus table if it exists
if (prospectus.Id != default(Guid))
{
await DeleteAsync(prospectus.Id);
}
}
else
{
prospectus = await _prospectusRepository.InsertAsync(prospectus, autoSave: true);
}
return ObjectMapper.Map<Prospectus, ProspectusDto>(prospectus);
}
At var student = ObjectMapper.Map<ProspectusCreateDto, Student>(input);
Solved it!! It was different version numbers between suite and Dependancies. All set to 4.1.1 and it works.
Success!! Thanks for that, I don't know what caused the errors but they have finally resolved themselves. I have my dropdowns working.
Hi Alper :-) Sorry for the delay been on holiday :-)
Just updated to 4.1, getting the following error, but regardless it still shows the same issues using MVC
[12:34:33 INF] ABP CLI (https://abp.io) [12:34:34 INF] Version 4.1.0 (Stable) Starting Suite v4.1.0 ... [12:34:44 ERR] ABP-LIC-0016 - You are not granted permission to use the module 'Volo.Abp.Suite-v4.1.0.0'.
Generating a new entity with suite 4.02 works OK. However the entry added to the menu in EducatePlusMenuContributor.cs fails to show on the menu itself. I have worked at rearranging the entries, changing the order numbers, Clean and rebuild the project, but fail to get a new menu to show.
I suspect if (await context.IsGrantedAsync(EducatePlusPermissions.TestForMenus.Default)) if not returning true, what can I add to the else statement to get an error message. All entities are the same multitenanted.
Example menu items
if (await authorizationService.IsGrantedAsync(EducatePlusPermissions.Dashboard.Tenant))
{
//TenantDashboard
context.Menu.AddItem(
new ApplicationMenuItem(
EducatePlusMenus.TenantDashboard,
l["Menu:Dashboard"],
"/Dashboard",
icon: "fa fa-line-chart",
order: 4
)
);
}
if (await context.IsGrantedAsync(EducatePlusPermissions.Ethnicities.Default))
{
context.Menu.AddItem(
new ApplicationMenuItem(
"EducatePlus.Ethnicities",
l["Menu:Ethnicities"],
url: "/Ethnicities",
icon: "fa fa-file-alt",
order: 12)
);
}
this one won't show,
if (await context.IsGrantedAsync(EducatePlusPermissions.TestForMenus.Default))
{
context.Menu.AddItem(
new ApplicationMenuItem(
"EducatePlus.TestForMenus",
l["Menu:TestForMenus"],
url: "/TestForMenus",
icon: "fa fa-file-alt",
order: 13)
);
}
Actual output