« first day (2007 days earlier)      last day (2949 days later) » 

12:00 AM
other way around
 
so your ftmember entity has the BirthMonth virtual property right?
it should also have a BirthMonthID or something similar
 
public string BirthMonth { get; set; } (In ViewModel)
 
your foreign key column is a string?
 
No, int
 
or are you just not including foreign key columns in your model
 
12:01 AM
With my current options, I wasn't doing that.
 
ok
well if you do that its a bit easier to see whats going on imo
I mean, you probably could assign to that virtual property and save it
but its hard to say from here whether you're doing it right
 
hmm
so,
ftmember.BirthMonth.Id = Int32.Parse(editfamilytreemember.BirthMonth); is wrong?
 
especially when you're not doing a .Find() on the table you're doing some weird ORDefault stuff
Definitelyu
because you're changing the PRIMARY key of the referenced table
not the foreign key of the referencing table
 
user47589
weird ordefault stuff lol
 
exactly, I tried once before
 
12:03 AM
thats really really bad
don't do that
 
sorry for being dumb, because I'm new to MVC
 
its ok
 
so, what should I do now?
You said to do:
ftmember.BirthMonthID = Int32.Parse(editfamilytreemember.BirthMonth);
 
I'm just not sure if FirstOrDefault etc get an actual tracked entity or if they just puke data out. Not the best at EF myself
If editfamilytreemember.BirthMonth is supposed to be the ID of the BirthMonth in the database
then yes
hard to say when I can't see your entities
 
Do you want to see the DD model or ftmember model?
@Jakotheshadows you're right...
 
12:06 AM
posted on April 13, 2016 by Scott Hanselman

I was having a chat with a new friend today and we were exchanging stories about being working parents. I struggle with kids' schedules, days off school I failed to plan for, expected things (cars break down, kids get sick, life happens) while simultaneously trying to "do my job." I put do my job there in quotes because sometimes it is in quotes. Sometimes everything is great a

 
Right, I understand that
but LINQ isn't the only concern here
Entity Framework is also in play here
and that is the part you're having problems with: things not saving in your database
 
that feel when a coworker refucktors your code
 
@Jakotheshadows I will try more... Thanks for your help.
 
Try using .Find instead
not sure if there is an async option for that or not
or why/if you actually need async controller actions / and awaits in your controller code
I've never needed them myself so I'm a bit ignorant when it comes to who uses them and why
 
12:11 AM
To be honest, I'm still not clear about Async
On some Controllers I use and some don't, I hate this type of behavior that I have.
 
are you writing all this code or are you maintaining someone else's?
 
My own code
 
then do your self a favor and throw that async crap out if you're not sure why you're doing it
if you don't know why you need it then the answer is you don't
why complicate things
 
I will star your comment
It's correct.
let me try .Find
As info: there is FindAsync
 
good to know
 
12:15 AM
yup
 
with .Find you pass in the primary key of the entity you're looking up
 
ftmember.BirthMonth = db.MonthDD.Find(editfamilytreemember.BirthMonth);
right?
 
if editfamilytreemember.BirthMonth is a primary key value
for the MonthDD table
 
Value for BirthMonth in DropDown is Id like 1,2 ....
 
and those correspond to the primary key column in MonthDD right?
 
12:17 AM
yes
 
now in your view model
 
is editfamilytreemember.BirthMonth a string or int
 
you'll need to convert it to int first then
 
12:18 AM
in Controller?
 
why do you have 3 columns with the same data in there
you could do that
or you could just change your view model
 
Id,Code,OrderIndex?
 
so that it binds as an int
yeah
change the type of BirthMonth in your view model from string to int
especially since the value really is going to be an int anyways
then you don't have to add extra logic in your controller
 
In here it's not really useful, but in other tables it's very handy.Example:
-Id is Automatic Id
-Code: Normally in other tables is something like A as Active and etc...
-OrderIndex: In case we need to shift the order we can play with that
@Jakotheshadows yes, I'm doing it right now.
Normal scenario
 
Ok
Well to be safe, make sure that the options in your edit view come from the Id Column and not the code or orderindex column, otherwise things may become clusterfucked
 
12:22 AM
should the int be nullable?
 
unless birthmonth is not required
 
it's not required
It can be blank
I'm actually building this application for UNHCR in Kenya
 
then go ahead and let it be nullable
 
12:23 AM
ok
 
just make sure you don't do a find on a null int
that would be bad
 
how bad?
 
just leave the FK null in your data model before you save
you'd get an exception... so not terrible but not good either
either that or it wouldn't compile is my guess
but it doesn't make sense to say Find(null)
 
I used to have this when it was string not int: This is on Get method where values get populated
BirthMonth = getftmembers.BirthMonth == null ? string.Empty : getftmembers.BirthMonth.Code,
No, I've got intell. error.
 
well I'm about out of energy on this one bud
I gotta get going
hope you figure it out
 
12:26 AM
Thanks for your time.
 
@NoMore_CodeMaster you should store dates as dates
 
The issue is that we might never save a full date (Day Month Year)
Therefore I had to separate them.
 
ah
 
We are dealing with refugees and survivors, so they don't even know who they are and when they were born...
:(
@Jakotheshadows as info: It doesn't save the new value... :(
 
@SteveG I store dates in my stomach
yummy yummy
 
12:42 AM
mmmm
 
I don't store data, it all does the state for me and the rest is covering google and microsoft :D
Fail haha didn't get the context
 
1:13 AM
mmmm
 
1:51 AM
Hello
 
 
2 hours later…
3:58 AM
Hi guys
anybody here who have done facebook authentication?
 
 
1 hour later…
5:22 AM
sup
 
5:56 AM
posted on April 14, 2016 by Scott Hanselman

What's going on with ASP.NET Core 1.0 RC2? Why is RC2 taking so long over RC1 and what's going to happen between now and the final release? I talked to architect David Fowler about this and tried to put together some clear answers. This stuff is kind of deep and shows "how the sausage gets made" so the TL;DR version of this is "the guts are changing for the better and it's taking longer than w

 
MMMMMMMM
 
6:19 AM
hi
 
6:40 AM
HOw can I get ICollection childs of a entity
 
In EF? Create a Navigation Property.
 
I don't need to create it, it's already there
can someone remove above giff please, it's killing my browser
 
Sunday: We're going to have daily 10:00am meetings *every day*. Mandatory attendance. This is important, people!
Monday: One guy's late. We'll think of a suitable punishment later.
Tuesday: Guy's late again.
Wednesday: Two guys are late.
Today: It's 9:45 and I'm the only one in the office.
Right.
@Mathematics Sorry. It appears my mod-hood is occasionally given and revoked and given again. *shrug*.
There are usually enough mods around so that I'm not really needed.
 
Thanks :)
@AvnerShahar-Kashtan Sounds like a joke :P
I am trying to create a structure of DB in json
e.g. Tables, that could connect to other tables
 
6:57 AM
Morning all
 
@AvnerShahar-Kashtan you weren't having daily meetings before?
@Mathematics why?
 
@TomW My end user wants to select given table and query them at run time
so I need to know which table can be joined to which one at run time
 
☺/
 
o/
 
7:06 AM
why I can't type
 
Aloha
 
@Mathematics you're basically re-writing a bad version of Excel Power Query here, aren't you?
sorry but I think this is a fool's errand
 
@Squiggle Yes, but HOW :(
 
how what? :S
I'm asking "why?"
 
I am not sure if it's possible
adhoc reporting...
 
7:16 AM
it's clearly possible - Microsoft has done it. You interrogate the schema of the database and use that as a basis for your queries.
 
@Squiggle should I hard code schema ? or there is a way out
 
the problem is that databases are often poorly defined, and you end up having to configure the foreign keys yourself becase they're not all there
which is what Excel allows you to do
 
I think there is one way I could do it...

Generate Model using reverse code first..

Then get all objects, then each object has navigational properties
Should I get navigational properties (which are ICollections)
 
in theory that could work, for decent schema :)
is Schema plural?
 
yup
 
7:19 AM
'k.
I still don't understand why you're trying to do this. There already exist very powerful tools for it.
 
I need it in asp.net
with custom UI
 
7:33 AM
Hmm, was i too harsh in my comment to this question("Answer"): stackoverflow.com/questions/36616099/… I felt bad posting but a neccessity to do.
 
no harshness
 
Was i being reasonable ?
I felt bad :p
 
it was reasonable.
 
@Froxer "should HAVE been" not "should OF been" :/
<-- grammar despot
 
I appreciate it @Squiggle I will go and edit.
 
7:46 AM
@TomW Have I not whined about our total lack of decent R&D procedures before?
 
Good morning everyone!
 
wow, CAN i even edit a comment ?
 
@Froxer I think You can edit comment for a short period of time
 
@Froxer I don't get your comment. His answer is the answer to his question.
He should probably delete the question, but that's another problem.
 
wow.
 
7:54 AM
such comment
 
I blame 4 h sleep
 
Good morning.
 
Re reading the post
OBVIOUSLY he answered his own question
wow
#ShootMeNow
 
but I still don't really understand his question
 
Well he didnt understand that he changed the name of his collection
Once he understood that, he correlated the foreach to it.
But how i didnt fucking understand that the first time i read the thread is beyond me atm.
dont even ask
So he answered his own Question by asking the Question. And then proceeded to write a one liner no code provided answer to it.
gg.
 
7:59 AM
@AvnerShahar-Kashtan yes, not specifically about meetings iirc
I thought you were criticising the establishment of meetings, not the lack of commitment to them
 

« first day (2007 days earlier)      last day (2949 days later) »