We have multiple customers (tenants) whose employees do not always have an email address. How can we create a user with UserManager with an optional (null) email address?
Hello,
We saw the update to ABP Zero to go to 3.0. We cloned a new version and tried to build we get many reference errors. There is a screenshot attached of the references in the Application project. When we try to upgrade via nuget to ABP 3.0.0 we also get these errors. We are using the .Net 4.6 template (not Core). We started by trying to use git to merge changes with the commit of 93fb08209b96264527ac357163a8f78605913efa and also got these errors. We tried on two different development PC's and still get these errors. We are running VS 2017 version 15.3. Do you have any suggestions on how to resolve this?
Now that Metronic 5 is out [https://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469]), are there plans to upgrade to it? We would like to upgrade to jquery 3.x but we think Metronic was the bottleneck. Would it be possible in the future to upgrade Abp to only need jquery 3.x?
Thanks!
if the database or database server specified in the connection strings of the web.config file cannot be found, we would like to redirect to a more graceful error page. The error will first appear for us in global.asax.cs > Session_Start > RestoreUserLanguage.
I can trap the error by doing something like this inside a try-catch
SqlConnection connection =
new SqlConnection(ConfigurationManager.ConnectionStrings["Tenant"].ConnectionString);
connection.Open();
: if this fails, then I would like to redirect/transsfer/execute something to get to a Error/NoDb. I have an ErrorController.cs with this view, but cannot figure out if it is possible to get there because the database does not exist. Is this possible with ABP.Net Zero?
Hey Volosoft,
Do you have a recommended method of using a test double for ISettingManger or SettingManger in a unit test?
I know I have to avoid the generic extension methods as they are not mockable.
So my production code looks like this (see unabridged as DateRangeInvalidAsync.png):
var setting = await _settingManager.GetSettingValueForApplicationAsync("DateRangeMaximum");
Int32.TryParse(setting, out int yearLimit);
My unit test method has this code (see unabridged as EnrollmentAppServiceTests.png):
_settingManager.Setup(x => x.GetSettingValueForApplicationAsync("DateRangeMaximum"))
.Returns(Task.FromResult("100"));
My test configuration consists of XUnit, Moq and Autofixture. The error I get is [https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp/Configuration/SettingDefinition.cs]) requires a parameterless constructor.
Hello,
We have a need to load configuration settings from a config.ini file (it is in the bin folder of the project) at start-up. In a winform project we have MyCompanyName.AbpZeroTemplate.WinformApp. AbpZeroTemplateProviderModule:
public override void Initialize()
{
IocManager.IocContainer.Register(Component.For<ConfigurationManager>()
.DependsOn(new { fileName = "restapi.ini"}));
}
This works and everything is happy.
When we try to do the same in the web project, it fails to load the file. Is there something we are forgetting to check or is there a better way to load program configuration settings which we don't want the user to see?
Thank you
Hello,
We have a host and a tenant database. When we run update-database for the Tenant, it will add the settings: update-database -verbose -projectname MyCompanyName.AbpZeroTemplate.EntityFramework -startupprojectname MyCompanyName.AbpZeroTemplate.Web -configuration MyCompanyName.AbpZeroTemplate.AbpZeroTemplateTenant.Configuration We now have settings and that is great. When we run this again, the settings are duplicated. We have traced this to DefaultSettingsCreator.cs > AddSettingIfNotExists. It looks like this:
private void AddSettingIfNotExists(string name, string value, int? tenantId = null)
{
if (_context.Settings.Any(s => s.Name == name && s.TenantId == tenantId && s.UserId == null))
{
return;
}
_context.Settings.Add(new Setting(tenantId, null, name, value));
_context.SaveChanges();
}
In debugging this, it appears that _context.settings always has a count of 0. I thought this might be the wrong context, but the Add method works. Does anybody know what could cause this situation?
We have two entities defined as:
public class UserImport : AuditedEntity
{
public int Position { get; set; } = -1;
public string Last { get; set; }
public string First { get; set; }
public string DepartmentId { get; set; }
public DateTime? Date { get; set; }
public string IdBadge { get; set; }
public string JobCodeId { get; set; }
public string EmailAddress { get; set; }
public virtual UserImportPresentation Presentation { get; set; }
public override string ToString()
{
return $"{Last}, {First}";
}
}
and
public class UserImportPresentation : Entity
{
public int UserImportId { get; set; }
public string Name { get; set; }
public string Department { get; set; }
public string JobCode { get; set; }
public virtual UserImport UserImport { get; set; }
}
We save a record like this from our EnrollmentAppService : AbpZeroTemplateAppServiceBase, IApplicationService:
foreach (var import in imports)
{
await userImportRepository.InsertAsync(import);
var presentationUser = BuildUserImportPresentationResult(import, departments, jobCodes);
await userImportPresentationRepository.InsertAsync(presentationUser);
}
Note that userImportPresentation has a foreign key to userImport. When we try to save a new record to these tables we get "Validation failed for one or more entities."(image attached)
It appears that the first save has not written yet and is expected for the second save. Is there a way to force the save to importUser before the insert to userImportPresentation?
We have been successfully using signalR in our application. We recently upgraded to version 4 .0 here: 683de.... After that we are getting this javascript error:
VM41:1 GET http://localhost:5000/signalr/start?transport=webSockets&clientProtocol=1.5…22abpcommonhub%22%7D%2C%7B%22name%22%3A%22chathub%22%7D%5D&_=1493234804063 500 (Internal Server Error)
Are there any known issues with using signalR with the latest version?
Hello,
We have a service that is inserting a record like this:
// GroupAppService
public GroupDto Add(GroupAddDto dto)
{
if (String.IsNullOrWhiteSpace(dto.Name))
return GroupDto.NullInstance();
var group = dto.ToGroup();
var id = _groupRepository.InsertAndGetId(group);
group.Id = id;//id is always zero
return dto.FromGroup(group);
}
We are calling this service from our controller like this:
// GroupController
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Add(GroupAddViewModel viewModel)
{
if (!ModelState.IsValid)
return View(viewModel);
var dto = new GroupAddDto(viewModel.Name);
var returnedDto = _groupAppService.Add(dto);
if (returnedDto.Id == 0)
return Content($"Group with name {returnedDto.Name} returned id is 0.");//this is hit every time and data is inserted
return RedirectToAction("Index");
}
The information is saved to our table (see attached). But the id returned is always zero. We tried to follow the advice from [https://github.com/aspnetboilerplate/aspnetboilerplate/issues/1387]). Do you know how we can get the ID back of the group inserted?