In WPF Sample there is only one form. How can I create another form and use dependency injection ?
for example:
private readonly IPersonAppService _personAppService;
public MainForm(IPersonAppService personAppService)
{
_personAppService = personAppService;
InitializeComponent();
}
how can I create a new MainForm(and showdialog) ?
After updating to ABP v0.7.7.1 I have an error in my Application Service I found that when I inject
private readonly ITotalAppService _totalAppService;
error occurs.
it had no errors before.
I Create a new class and derived from "XAppServiceBase", but when I want to use "UserManager" in that class, it is null !
public class GeneralAppService : IAUAppServiceBase
{
public string GetStateName(long userId)
{
//I want to use UserManage Here but it's null !
}
}
How Can I Create a DTO from these classes :
public class RegisterRequest : Entity
{
public int? UnitId { get; set; }
.
.
.
.
public virtual Unit Unit { get; set; }
}
and
public class Unit : Entity
{
public Unit()
{
RegisterRequests = new HashSet<RegisterRequest>();
}
public string UnitName { get; set; }
.
.
.
public virtual ICollection<RegisterRequest> RegisterRequests { get; set; }
}
that contains whole "RegisterRequest" class and "UnitName" of "Unit" class.
thank you
I get this error when run the project and I can not trace it
Input string was not in a correct format!
this is stack trace
[FormatException: Input string was not in a correct format.]
System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +12099621
System.Number.ParseInt64(String value, NumberStyles options, NumberFormatInfo numfmt) +133
System.Convert.ToInt64(String value) +51
Abp.Runtime.Session.AbpSession.get_UserId() +89
Abp.Authorization.<AuthorizeAsync>d__0.MoveNext() +60
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +99
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
Nito.AsyncEx.<>c__DisplayClass3.<Run>b__1(Task t) +56
System.Threading.Tasks.ContinuationTaskFromTask.InnerInvoke() +52
System.Threading.Tasks.Task.Execute() +47
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +99
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
Nito.AsyncEx.AsyncContext.Run(Func`1 action) +201
Abp.Authorization.AuthorizeAttributeHelper.Authorize(IEnumerable`1 authorizeAttributes) +71
Abp.Authorization.AuthorizeAttributeHelper.Authorize(IAbpAuthorizeAttribute authorizeAttribute) +43
Abp.Web.Mvc.Authorization.AbpMvcAuthorizeAttribute.AuthorizeCore(HttpContextBase httpContext) +85
System.Web.Mvc.AuthorizeAttribute.OnAuthorization(AuthorizationContext filterContext) +160
System.Web.Mvc.ControllerActionInvoker.InvokeAuthorizationFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor) +97
System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__19(AsyncCallback asyncCallback, Object asyncState) +743
System.Web.Mvc.Async.WrappedAsyncResult`1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +14
System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +128
System.Web.Mvc.Async.AsyncControllerActionInvoker.BeginInvokeAction(ControllerContext controllerContext, String actionName, AsyncCallback callback, Object state) +343
System.Web.Mvc.Controller.<BeginExecuteCore>b__1c(AsyncCallback asyncCallback, Object asyncState, ExecuteCoreState innerState) +25
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +30
System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +128
System.Web.Mvc.Controller.BeginExecuteCore(AsyncCallback callback, Object state) +465
System.Web.Mvc.Controller.<BeginExecute>b__14(AsyncCallback asyncCallback, Object callbackState, Controller controller) +18
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +20
System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +128
System.Web.Mvc.Controller.BeginExecute(RequestContext requestContext, AsyncCallback callback, Object state) +374
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.BeginExecute(RequestContext requestContext, AsyncCallback callback, Object state) +16
System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__4(AsyncCallback asyncCallback, Object asyncState, ProcessRequestState innerState) +52
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +30
System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +128
System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +384
System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state) +48
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +16
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +103
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
What's wrong with AbpSession UserId ? How Can I Solve the problem?
Is it Possible to define permissions in AbpPermission in database?
I define a permission
public class EPEDCAuthorizationProvider : AuthorizationProvider
{
public override void SetPermissions(IPermissionDefinitionContext context)
{
var administration = context.CreatePermission("Administration", new FixedLocalizableString("Site Admin"), true);
}
}
but it is not stored anywhere ! and All Users are granted for it by default!
How can I define Permissions for specific Roles and Users?
Why AbpSession.UserId is null in my Application layer? I disabled multytenancy!
How can I config Identity with "ApplicationUserManager" and customize "UserValidator" and "PasswordValidator" and ...?
I use this function to remove roles, why user roles remain ?
public async Task DeleteRolesAsync(List<string> deleteList, long userId)
{
foreach (var roleName in deleteList)
{
IdentityResult deletionResult = await _userManager.RemoveFromRoleAsync(userId, roleName);
}
}
Can I Show a progressbar when views change?