Tagged Questions
2
votes
1answer
56 views
Cleaning User Input
I am not sure if I am approaching this task the correct way. I have a view model with multiple string properties. I pass the model through an interface to a service class that contains a void to ...
6
votes
1answer
3k views
ListBox for a many-to-many relationship
I'm looking for a good and easy to use solution for creating MultiSelectLists in MVC for many-to-many relationships.
I have this following example code and it works fine, but it just takes a lot of ...
5
votes
1answer
87 views
3
votes
1answer
43 views
Settings class for web app
I needed to write a settings class for my web app; ideally this class should read its settings from a file (and be able to save them back to the file), and have only 1 instance per application - all ...
7
votes
1answer
105 views
Fluent Nhibernate, is the mapping correct?
I'm very new to NHibernate and DB. I have three tables which are connected with many to many relationship.
Here are the tables creation Script:
...
4
votes
2answers
128 views
ASP.NET MVC architecture questions
I haven't done much .NET development in several years. Now I'm enjoying some of the new stuff with modern .NET. I just want to make sure I'm using things correctly. I'm a solo developer with no one ...
1
vote
0answers
59 views
Using MVC design pattern to create server [closed]
I would like to to create a server application that listens to a remote client via TCPlistener and output the message to a form.
What I've done so far is :
1) in the ...
2
votes
1answer
211 views
Where to put common method used in controllers that calls service layer?
I have an asp.net mvc5 web application using the repository pattern, and I have several controllers that need to call my _loggingService (queries audit logs) to get the last updated information for ...
3
votes
1answer
94 views
Session state wrapper, extending an existing application
I'm adding additional functionality to an existing MVC .net application, and to help prevent or at least reduce repeated reads to the dB I'm dumping a few custom entities in session. I'm limiting what ...
2
votes
2answers
138 views
Is this data access layer design good?
I am working on an ASP.NET MVC-5 project, using code-first approach for database design. I have a question about my code design.
I have an Entity in my database schema called ...
2
votes
1answer
2k views
Refactor Windows Form code to follow MVC
I started an open source Markdown editor using C#. I'm a huge fan of the MVC pattern, however I am having trouble refactoring my back-end form code. It's getting pretty long and I was wondering if ...
2
votes
1answer
115 views
4
votes
1answer
201 views
How can I refactor my Controller Action to not be so complex?
I'm building a website that is used to search our system. The users can search on a lot of critera at once. As I try to do this though, I can't figure out how to simplify this horrible action.
...
2
votes
1answer
1k views
REST-ish API Account Controller - how's it look?
I still have to implement api keys for client auth, but so far this is what I have for users. This was built using WebAPI and SimpleMembership with Forms Auth:
Is Authenticated:
...
1
vote
0answers
76 views
Data Access Objects and Entity Relationships
What is the proper way to structure DTO's for my tables?
Three of my tables are Documents which contains Pages and Fontstyles. I am creating an EditDocument view in which I will edit these (and more) ...
7
votes
1answer
2k views
passing a selectlist to the view based on database models from viewmodel is a MVC anti-pattern?
We need to select a model reference from a view.
To do this we need to add a dropdownlistfor.
this is based on a selectlist containing database models.
passing selectlists by viewbag
this solves our ...
2
votes
0answers
96 views
PBKDF2 Authorization first go, is this optimal?
I've discovered that using hashed passwords with salts is much better idea than MD5/SHA256 so I'm not hashing them with PBKDF2. However I'm wondering if this is correct approach to authorize my user. ...
0
votes
2answers
179 views
How could I make my controller a little less hideous?
I have a controller. It functions as follows:
A user imports a file and decides whether the files contents contain new entries to be placed into a database, or existing entries entries to be updated.
...
5
votes
2answers
1k views
ASP.NET MVC using an N-Tier Model and DDD
Any comments are welcome. However I'd like to call specific attention to my... interpretation of the N-Tier application architecture and how I'm consuming data. Note that the namespacing and inline ...
1
vote
2answers
3k views
Need help in MVC Winform example project to add a record into the DB [closed]
I want to learn MVC pattern using winforms and I have read some tutorial to understand.
Now, i'm working on my own example to just add a customer records in a database using MVC pattern.
The ...
1
vote
0answers
301 views
Amazon s3 pass through controller [closed]
Some background, I am building a website that uses amazon s3 to host its image (and other) files.
I required that images displayed on the website look like they come from my site and not from amazon ...
3
votes
2answers
2k views
Best practices for decouple classes in C#
So this is a lot more confusing than it has to be (I could just stick all of this in the main class with the ui event handlers) but I wanted to decouple this class for learning purposes.
Basic ...
3
votes
2answers
719 views
Passing HTML back inside a JSON object
First question on here. I'm working on a piece of code in my MVC3 application and I'm struggling to decide if what I plan to do is a bad idea or not.
I have a snippet of javascript that calls an mvc ...
1
vote
2answers
470 views
A faster way to look up for a url in a WebRequest/WebResponse html
What I'm trying to do here is get an RSS feed and append an Enclosure XML node to each item, which has a link to a video file (wmv).
Try the below code with
...
4
votes
3answers
553 views
Not feeling 100% about my Controller design.
Basically, I'm uploading an excel file and parsing the information then displaying what was parsed in a view.
...