Solved

Contant UI messages in .NET

Posted on 2016-09-08
1
51 Views
Last Modified: 2016-10-21
Hi

I have some standard UI messages like Error or Info. All are sent from the .Net Web Api service to UI angularjs.

There may be around 5-10 messages for now. This may increase in future.

1> Should I maintain them in the respective Business Class as constants.
2> keep them in Web.Config of the Web api
3> Or Global.asax of the Web api

What is the best practice. If you have any examples i.e helpful also. considering or performance, code maintenance and resusability. There is no database here.

Thanks in Advance
0
Comment
Question by:Member_2_7967608
1 Comment
 
LVL 29

Accepted Solution

by:
anarki_jimbel earned 500 total points
ID: 41793693
As I understand these messages are intended for users (customers). In this case I wouldn't maintain these messages hard-coded in business classes. You may need to change them, or you may need to translate them (which is quite common). In this case config file is better, I'd say.

Also check this MS forum: Where to keep an application constant?

Or this one: ASP.NET MVC - Using Resource Files to Manage String Constants

Eventually it depends on your specific needs.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now