WorkFlowDefination not Found in Elsa 2.4 Version - elsa-workflows

I am new in Elsa .net library.
I have define one Activity in which i have to define input paramater for the activity
like below way as document saw in version 1 :
public WorkflowExpression<string> UserId {
get => GetState<WorkflowExpression<string>>();
set => SetState(value);
}
but it give me error that The type or namespace could not found
as i don't know can somebody help me with this.
I read the whole documentation nothing will define this.
Any Help will be appreciated.

If you're just getting started with Elsa, then please make sure to use Elsa 2, since Elsa 1 isn't supported anymore.
With Elsa 2, you can define your activity input as follows:
[ActivityInput] public string UserId { get; set; }
For more information, make sure to checkout the documentation about activity properties.

Related

Shortcuts for getting all the parameters of a blazor component

Is there a way to set up intellisense to do the following thing:
As components come with parameters, and parameters without default values will most likely be required anyway. Is there a way to just 'tab tab' and get all the unused parameters when adding a component to the page?
i.e.
Say that I have a component called "Sample" with the following params:
[Parameter] public string AAA {get;set;}
[Parameter] public string BBB{get;set;} = "HELLOHELLOW";
[Parameter] public string CCC{get;set;}
can I do <Sample></Sample> and then perhaps do 'tab tab' to make it <Sample AAA="", BBB="HELLOHELLOW", CCC=""></Sample>
Often, I have components with 4 or 5 parameters and it's both time consuming and a pain to handle them one by one...
Your idea is a brand new feature for Intellisense. And so far, I only found is that code snippet.
But code snippet cannot automatically and flexibly generate the corresponding structure based on the parameters in your component file. It must be hard-coded rather than soft-coded.
Unless, you write
<Code Language="XML">
<![CDATA[<Sample AAA="", BBB="HELLOHELLOW", CCC=""></Sample>]]>
</Code>
Obviously this is not a good method nor what you want. And there is no such function to realize this and Intellisense is not so flexible to achieve this.
So you have to suggest your idea to the Team. Suggest a feature on our DC Forum.
When you finish it, you can share the link here and anyone who is interested in it will vote it and it will help get more Microsoft's attention.

Can't get the language entity with the method _languageRepository.FirstOrDefault(x=>x.Name=langCode)

Please help me solve this issue ,it drivers me mad .Thank you in advance.
Version:3.1.3 Abp ModuelZero MPA
I need to get the language id by language name from Database.
So I inject the Repository as below.
private readonly IRepository<ApplicationLanguage> _languageRepository;
Then I use the below method to get the language entity
var lang = _languageRepository.FirstOrDefault(x=>x.Name==langName);
but the result is null .The parameter is 'zh-TW' and I am sure it exists in database.
The below screenshots for your reference.
var lang = _languageRepository.Where(x=>x.Equals(langName)).FirstOrDefault();
return lang?.Id;
lang?.Id is to handle null.

How to use higher version for web api controller

I am following below:
https://www.hanselman.com/blog/ASPNETCoreRESTfulWebAPIVersioningMadeEasy.aspx
Is it possible to have directly higher version for a web api controller.
like:
ApiVersion("2.05")]
[RoutePrefix("api/v{version:apiVersion}/ger")]
public class caGerController
[Route("~/api/ger/getDetail")]
[Route("getDetail")]
GetGerData
when using above one, it only works when using URL as api/v2.05/ger/getDetail
But It fails working while using URL as api/ger/getDetail and getting message as "Code": "ApiVersionUnspecified",
If change version from 2.05 to 1.0 (as all other controller) then api/ger/getDetail works.
How to solve this, I need 2.05 for this controller and need to access api/ger/getDetail URL as well.
Thanks
Since you are versioning by URL segment, you'll have to do a few things. First in the options, you need to allow implicit versioning using:
options.AssumeDefaultVersionWhenUnspecified = true;
Your original API had some version that was never declared or named. The default configuration will use "1.0". If you want the default to be something else, specify:
options.DefaultApiVersion = new ApiVersion( 2, 0 );
The next step is that you have to float the route template on the controller that you want to have the default path. ASP.NET and all other stacks I know do not have a way to provide or fill-in default values in the middle of the route template.
If "2.0" is your initial, default version, then your controller will look like:
[ApiVersion( "2.0" )]
[ApiVersion( "2.05" )]
[RoutePrefix( "api" )]
public class GerController : ApiController
{
[Route( "ger/getDetails" )]
[Route( "v{version:apiVersion}/ger/getDetails" )]
public IHttpActionResult GetDetails() => Ok();
}
If you change the controller that maps to the default route, you have to move the route template to that new controller type.
This is an unfortunate consequence of versioning by URL segment. If you don't change the default route mapping, then it shouldn't be a big deal to manage; otherwise, you should consider disallowing implicit versioning or elect an alternate versioning method.
For more information, please refer to this wiki topic.

Is it possible to retrieve schema change information in Dynamics CRM online?

When a custom entity is created, a field is added or changed, someone makes an out-of-box changes to metadata.
How to know who did it and when?
The same for the creation or modification from a UI form. The metadata in CRM doesn't seem to store that information.
I think it is not possible to access information you're asking for. Such a information is not available in the on-premise CRM database and I suppose there is a similar situation with CRM Online
Not exactly what you are looking for. But this will be a good starting point to achieve what you want.
Using RetrieveMetadataChangesRequest, we can get the schema changes like:
Adding a custom entity named sample_SampleEntityForMetadataQuery with
a custom optionset attribute named : sample_ExampleOptionSet
ClientVersionStamp: 296646!10/22/2012 21:42:06
Adding an additional option to the sample_ExampleOptionSet attribute
options
Deleting the sample_SampleEntityForMetadataQuery custom entity
--
Sample code can be found in MSDN/SDK.
protected RetrieveMetadataChangesResponse getMetadataChanges(
EntityQueryExpression entityQueryExpression,
String clientVersionStamp,
DeletedMetadataFilters deletedMetadataFilter)
{
RetrieveMetadataChangesRequest retrieveMetadataChangesRequest = new RetrieveMetadataChangesRequest()
{
Query = entityQueryExpression,
ClientVersionStamp = clientVersionStamp,
DeletedMetadataFilters = deletedMetadataFilter
};
return (RetrieveMetadataChangesResponse)_service.Execute(retrieveMetadataChangesRequest);
}

new RoleManager<IdentityRole> error missing arguments in VS 2015

I want to implement User and Role Manager in VS 2015 using the Identity.EntityFramework": "3.0.0-rc1-final".
Among others I have created a class IdentityManager.
My main problem is creating a method to check the existence of a Role as follows.
public bool RoleExists(string name)
{
var RoleManager = new RoleManager<IdentityRole>(new RoleStore<IdentityRole>(new ApplicationDbContext()));
return RoleManager.RoleExists(name);
}
I keep getting the error on new RoleManager<IdentityRole>:
There is no argument given that corresponds to roleValidators, keyNormalizer, errors, logger,contextAccessor"
Yes, basically all the parameters I am not specifying but I have no idea how to approach these.
I am very new at this and have been searching and trying for days now, if someone can just point me in the right direction I am willing to do the legwork and testing, I just need some documentation.
I am having a similar issue - it looks like the roles are not the best option in identity 3.0
This thread (ASP .NET 5 MVC 6 Identity 3 Roles Claims Groups) helped me get something working, but its sad that this is not better documented.
Here are my attempts at improving that. Asp.net.Identity (3.0.0.0-rc1-final)
in Startup.cs --> ConfigurationServices
//Define your policies here, they are strings associated with claims types, that have claim strings...
//they need to be in AspNetUserClaims table, user id, department, Dev to be allowed access to the Dev policy
//add the auth option, below that makes it work, and in the api controller, add the
//[Authorize("Dev")] attribute
//services.AddAuthorization(
// options =>
// {
// options.AddPolicy("Dev", policy => { policy.RequireClaim("department", "Dev"); });
// });

Resources