Sharp architecture Membership - model-view-controller

Maybe this is a stupid question, but I dont know how to use Membership in sharp architecture template. I have seen how it is done in asp.net MVC (with AccountController, AccountView, and AccountModel / all of them autogenerated and binded to membeship provider).
I hope that my question is clear..
Thank you in advance.

You would need to implement your own membership provider and register in web.config, and then then have the required repository injected into your provider, or simply use the service locator to get the IRepository.
Mauricio Scheffer has written a post about injected membership provider using windsor which should help you get started.

Related

How to Replace Web Service Binding - Tuscany SCA with Spring from scratch

I have had some experience of developing web services (standalone) which are called via angularjs single page apps. But, I now have a Java EE task which involves the following:
1. Removing a Tuscany SCA web service binding from some business components e.g. Customer, Accounts. The components are exposed as web services
2. Replacing the Tuscany Binding with a Spring Injection web service binding.
NOTE: The decision to replace Tuscany SCA with Spring is already made.
But, as a developer with experience of developing web service without any knowledge of the binding frameworks. I need some understanding of what these frameworks are, how I can wire this framework to my web service from scratch.
I don't just want to copy and paste and do try and error on a commercial project.
I am afraid, there was no KT, hence I am learning this the hard way!
Please, can someone help me in understanding this underlying framework or binding.
What are this binding or binding frameworks?
Why do we need them?
How is Tuscany SCA different from Spring?
Any help good, practical, code sample, online references etc will be appreciated.
Thanks.
You are not clear with concept of SOA, SCA and Tuscany.
First understand which type of webservice is written in your project whether RESTFul or SOAP. And then understand how SCA + Tuscany service is written for for RESTFul/SOAP service and then try to remove Tuscany from it.
Reference docs:
http://tuscany.apache.org/documentation-2x/sca-java-bindingrest.html
http://www.springsource.org/spring-integration

quickest way to implement .net authentication in Web Forms with Entity Framework 6

I have been checking resources to implement authentication in my web forms application built with entity framework. All examples I found are MVC-related. I have used regular Asp.Net Membership framework a long time before I began to use EF. However, I could not find Membership implementation with Entity Framework code-first. I did implement the Claims-Based Identity (EF created the tables for me in DB) but I do not know how to utilize it in the application (like login), and it looks more complicated to me. Can anyone guide me ?
There are a couple of good tutorials on the asp.net web site:
http://www.asp.net/identity/overview/getting-started/adding-aspnet-identity-to-an-empty-or-existing-web-forms-project
http://www.asp.net/web-forms/overview/getting-started/getting-started-with-aspnet-45-web-forms/membership-and-administration

Custom Membership Provider with Entity Framework

I have a MVC web application that I am using my own membership provider. I have implemented the Entity Framework with POCO’s, repositories, and a unit of work to both the MVC app and the Custom Membership Provider.
I am finding that when the data changes outside of the entity created in the membership provider, the data is not updated. The system works fine when the entities are short lived in a web request, but the membership provider is started with the web application and is not disposed like a controller.
I have read every post I could find and have not found how to overcome this limitation of Entity Framework. Do I have to resort to the old ADO code to get the latest data from the database?
Make sure you have overrided WebSecurity and other Microsoft Membership Provider classes at the right way. For Security reasons and the Architecture of Entity Framework, may not happen appropriate coordination among those. A good example for implementing sample membership provider with Entity Framework and Asp.net Membership provider can be found at The nuget gallery. I wish to be useful for you.

ASP.NET MVC 3 and WSE 2.0

I've an ASP.NET MVC 3 project and have been tasked with implementing a few UI controls. I need to call a few web services and bind the data to the UI controls. The problem is the web services host (we have no control over them) requires me to first implement a UsernameToken class (WSE 2.0) to authenticate the user and generate a security token. I understand WSE 2.0 is superceded by WCF in 2006. I don't want to switch back to VS 2005 to be able to use WSE 2.0. What are my options?
Thanks for any help!
Just add a Service Reference to your ASP.NET MVC application and point it to the web service WSDL. This will generate a strongly typed WCF client which is compatible with WSE. Here's an article which covers the different interoperability scenarios
I'm afraid the approach Darin Dimitrov didn't work. What I have ultimately done is installed WSE 2.0, then added dll reference to Microsoft.Web.Services2.dll found in the WSE installtion directory (c:\Program Files (x86)\Microsoft WSE\v2.0\Microsoft.Web.Services2.dll). I also modified the Reference.cs file of the service to inherit from Microsoft.Web.Services2.WebServicesClientProtocol. I was able to find the UsernameToken class and able to authenticate successfully.
I'm not an expert in this area so I'm not sure if this is the correct way of doing this, but it worked nonetheless.

Repository Pattern in ASP.NET MVC 3 and Entity Framework code-first via StructureMap

I'm creating a web app using ASP.NET MVC 3 and Entity Framework 4.1 code-first. I'm designing the project via Repository Design Pattern. I know how to implement RDP and Generic RDP. But my question is that using StructureMap is a good idea on this case? Thanks to any idea and help.
Well yes, but structuremap is more related, imo, to the DI approach you will use than the Domain specific approach you will implement.
I personally use AutoFac, but Structuremap is a also very good, you may want to consider also Ninject. All of them are really powerful and have a nice syntax to work with imo.

Resources