Request to add CreateEntity<T>()

Jul 15, 2011 at 4:56 PM

Please can I request you add this to your AuthenticationService, to bring it into line with the AuthenticationManager from the DeForce Business templates.
This is used to create LoginInfo with a Verifier, so that field error indicators work in the Login Prompt dialog.

As the remarks say, it is possible with an IoC call to the EntityManagerProvider, but I thought having it present was simpler.


    /// <summary>
    /// Used to supply a VerifierEngine to a VerifiableObject.
    /// </summary>
    /// <typeparam name="T"></typeparam>
    /// <returns></returns>
    /// <remarks>
    /// You might want to use your IoC of choice instead.
    /// </remarks>
    public T CreateEntity<T>() where T : VerifiableObject {
      var entity = Activator.CreateInstance<T>();
      entity.VerifierEngine = Manager.VerifierEngine;
      return entity;
Jul 17, 2011 at 11:08 PM

This CreateEntity<T>() method really doesn't belong on the AuthenticationService. This is something you would implement on a class that is responsible for creating VerifiableObjects. The DevForce Silverlight Business Template is modeled after the corresponding RIA services business template and I must assume that it used this approach, which we simply copied and adapted for DevForce. I really don't want to pollute the AuthenticationService with methods that have nothing to do with authentication.