TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Abhilash J A
530
2.4k
599k
How can I add each loop values in model class c#?
May 26 2016 12:17 AM
Hello Sir,
I don't know what to do.
Here, how can i add list of 'Cids' each value in viewmodel class. In this situation, I can not use List in class because the class using other areas without using List?
Please have a look at the attached file.
string clientIds = "";
ViewModel.ClientContract clientContract = new ViewModel.ClientContract();
foreach (var item in frm.AllKeys)
{
if (item.Contains("cb_"))
{
Mapper.CreateMap<ViewModel.ClientContract, ClientContract>();
var ids = item.Split(new[] { "cb_" }, StringSplitOptions.RemoveEmptyEntries);
// clientContract.ProductDetailsId = Convert.ToInt32(ids[0]);
clientContract.ManageClientDetailsId = manageproduct[0].Id;
clientIds = clientIds + Convert.ToInt32(ids[0]) + ',';
}
}
var Cids = clientIds.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
foreach (var id in Cids)
{
clientContract.ProductDetailsId = Convert.ToInt32(id);
/*Here, how can i add list of 'Cids' each value in viewmodel class. In this situation, I can not use List in class because the class using other areas without using List
?
*/
}
service.clientContract = Mapper.Map<ViewModel.ClientContract, ClientContract>(clientContract);
service.AddClientContract();
Attachment:
doubt.zip
Reply
Answers (
1
)
Remove keywords and operators from string expression
Setup and Deployment in VS 2012 insted of VS 2008