Request to add CreateEntity<T>()

Jul 15, 2011 at 3:56 PM

Hi,
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.

thanks
John

    /// <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;
    }
Coordinator
Jul 17, 2011 at 10:08 PM

John,
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.