Identity appuser and approle - identity

The type 'Entity Layer.Concrete.App User' cannot be used as type parameter 'TUser' in the generic type or method 'UserManager'. There is no implicit reference conversion from 'EntityLayer.Concrete.AppUser' to 'Microsoft.AspNet.Identity.IUser'.

Related

In JSON boolean type allow to pass int, instead of throwing error

Here,
isChecked and
isPrime both are the boolean type. If I am passing integer to both value, in my java code instead of throwing exception/error (code should expect either 'true' or 'false'), it is mapping with true value in my POJO class. I am assuming that it because of any number greater than 0 will take boolean true. To avoid this thing, any suggestions? I am using jax-rs for deserializing and serialize to java object.
#JsonProperty
private boolean isChecked;
(In setter method, it set with true value)

JRuby : How to specify java primitive array

How can I specify Java primitive array?
Java Object array type can be specified like
['a'].to_java(:string).is_a? java.lang.String[]
-> true
but I don't know how to pass Java primitive array class.
[1].to_java(:byte).is_a? ???
[1].to_java(:byte).is_a? byte[]
NameError: undefined local variable or method `byte' for main:Object
[1].to_java(:byte).is_a? :'byte[]'
TypeError: class or module required
[1].to_java(:byte).is_a? java.lang.byte[]
ArgumentError: illegal package name component: byte
What is a JRuby type of java primitive array type?
I found an answer.
[1].to_java(:byte).is_a?([].to_java(:byte).class)
-> true

Controller action enum parameter binding as string

I have a Web API controller action
[Route("{type}")]
public IEnumerable<Content> Get(ContentType type)
{
...
}
where ContentType is enumeration and type is being provided as a string and not as an integer.
As I've checked the JsonConverterAttribute class which seems it should be possible to put it beside a method parameter
[AttributeUsage(AttributeTargets.Class |
AttributeTargets.Struct |
AttributeTargets.Enum |
AttributeTargets.Property |
AttributeTargets.Field |
AttributeTargets.Interface |
AttributeTargets.Parameter, // <= HERE!
AllowMultiple = false)]
public class JsonConverterAttribute : Attribute
...
but this doesn't seem to work:
[Route("{type}")]
public IEnumerable<Content> Get([JsonConverter(typeof(StringEnumConverter))] ContentType type)
{
...
}
I'm getting an error:
The parameters dictionary contains a null entry for parameter 'type' of non-nullable type '....ContentType' for method '...' in '...'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter.
I also don't want to put this converter inside my global configuration as I want my enums to serialize as integers. There are just a few places where I need to deserialize them from strings.
The possible alternative is to pass in a string and parse it manually using Enum.Parse() method but I'd like to avoid it if possible.

what is the difference between * and Object

Let's say I have a class with some a couple properties:
public class MyClass {
public var fooProp:*;
public var barProp:Object;
}
What is the difference, practically speaking, between these? Are there variable types I can later assign to fooProp that I cannot assign to barProp?
Only untyped variables can hold the value undefined. Untyped variables are variables that either lack any type annotation, or use the asterisk * symbol for type annotation.
From ActionScript data type descriptors:
In previous versions of ActionScript, a variable with no type
annotation was automatically assigned the Object data type. This is no
longer true in ActionScript 3.0, which now includes the idea of a
truly untyped variable. Variables with no type annotation are now
considered untyped. If you prefer to make it clear to readers of your
code that your intention is to leave a variable untyped, you can use
the new asterisk (*) symbol for the type annotation, which is
equivalent to omitting a type annotation. The following example shows
two equivalent statements, both of which declare an untyped variable:
var x
var x:*
Only untyped variables can hold the value undefined. If you attempt to
assign the value undefined to a variable that has a data type, Flash
Player or Adobe AIR will convert the value undefined to the default
value of that data type. For instances of the Object data type, the
default value is null, which means that Flash Player or Adobe AIR will
convert the value undefined to null if you attempt to assign undefined
to an Object instance.
As an example:
var t:* = undefined;
trace(t); // outputs: undefined
var t:Object = undefined;
trace(t); // outputs: null

how to Alert integer values in Flex?

How can I alert an integer value in flex. I have a variable called total which is an integer.
If I try to alert it using
var total:int=myTest.length;
Alert.show(total);
it throws an errors saying that
1067: Implicit coercion of a value of type int to an unrelated type String.
the show method accepts only string values. How can I alert this int value?
Actually, what I want is to know the value stored in the total variable.
Alert.show(total.toString());
reference