The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
So not sure if this is what your looking for but I used the System.Linq.Expressions namespace
to build a dynamic link query to be executed against EF.
here is an incomplete sample for syntax example:
propertyToUse = workingProperty.Substring(0, workingProperty.IndexOf('.'));
Type propertyToUseType = GetEntityType(propertyToUse, incomingParentType);
ParameterExpression propertyToUseParameterExpression = Expression.Parameter(propertyToUseType, propertyToUse.Substring(0,1));
Expression parentExpression = Expression.Property(workingExpression, propertyToUse);
if (parentExpression.Type.IsGenericType &&
Expression childExpression = BuildPropertyExpression(propertyToUseParameterExpression,
workingProperty, comparisonOperation, compareValue);
Type func = typeof(Func<,>);
Type genericFunc = func.MakeGenericType(propertyToUseType, typeof(bool));
LambdaExpression predicate =
Expression.Lambda(genericFunc, childExpression, propertyToUseParameterExpression);
//we have call the AsQueryable on the collection since we don't have the compiler working for us and we need to use the any method
MethodInfo asQueryableMethod = typeof(Queryable).GetMethods()
.Where(m => m.Name == "AsQueryable")
.Single(m => m.IsGenericMethod)
Expression asQueryableExpression = Expression.Call(null, asQueryableMethod, parentExpression);
//call the any method with the lambda expression we set up
MethodInfo anyMethod = typeof(Queryable).GetMethods()
.Where(m => m.Name == "Any")
.Single(m => m.GetParameters().Length == 2)
returnValue = Expression.Call(
asQueryableExpression, //the source
predicate); // the lambda expression
There are other factories off the Expression class to help create parts this snip it does not show like
When deep in the pit of "why won't that button move up just a bit" and googling solution awash with divs, css margins and other cave drawings, I think there must be a way to grab elements from a tool bar and place them where I want then have compiler make it all just work.
I found one in WYSIWYG Web Builder and was able more or less to do what I had envisioned.
So, all you top gun web devs, do you use this stuff or hand roll it still because?
No. I use VS (various versions, or occasionally VS Code for PHP development) but NEVER use it in Source / Split view. When I need to tweak / debug CSS I just load the page in Chrome and use dev tools to inspect the applied CSS, add rules, adjust values, and even tinker with the HTML. Then copy/paste changes back to the source. The downside with that is I have to remember all the elements where I changed any CSS values; to make this manageable I tend to work in very small "increments" updating the source CSS / HTML frequently and reloading the page (all very well, of course, unless the page is the result of a complex or non-repeatable transaction).
But then I'm a technophobe; I tend to shun frameworks and a plethora of "tools". My trustiest tool is Notepad (the original version, not ++ or any other enhanced version).
Then copy/paste changes back to the source. The downside with that is I have to remember all the elements where I changed any CSS values; to make this manageable I tend to work in very small "increments" updating the source CSS / HTML frequently and reloading the page
You may want to explore the Filesystem tab in Chrome dev tools: it'll save your changes to the original CSS file.
Might just be for when you're working on a localhost webserver, but I've found it pretty useful.
I use editors first because I hate CSS layout, and a good designer takes care of a lot of the boilerplate though I usually have to go back and modify it by hand. Honestly, I prefer when the design team can produce a mock of the page all laid out and then I templatize and make it dynamic. But then I'm not a web developer and wasn't by trade, though i had to wear a lot of hats at some companies.
This is down to how html works. Html elements are placed in a "flow" and the browser "fills" the document space with how those elements flow in. Imagine a glass box that you tipped various amounts of different coloured sand into. Now imagine putting the same sand in a glass box that is wider, or narrower. The red sand might have been an inch from the bottom in the wide box but 2 inches from the bottom in the narrow box.
If you "just want this button up a bit" then you have to take it out of the flow. So if you just want red sand two inches from the bottom then take it out of the sand you flow into the box then stick the red sand to the outside of the box two inches from the bottom. Now no matter the size the box your red sand is always where you want it as it isn't part of the flow. Great....but now resizing the box (your browser) probably doesn't have all the effects you want. Let's say the box is only 1 inch tall and your red sand is "two inches from the bottom"....it's no longer in the view plane.
So it is indeed possible to do what you want by taking elements out of the flow (the css term is absolute positioning) but it results in html that is very easy to break. So instead designers use tricks that ensure the elements look good no matter what container they are flowed into.
This is down to how html works. Html elements are placed in a "flow"
You know what else flows? Sewage. Strangely enough...
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
You didn't say what type of project you are working on, which matters a little bit.
If you are using Visual Studio Code, or Visual Studio "Classic" - the editors are a bit different.
If its an Angular Project, you can get a lot of help using Google Material Design.
Generally what I do is start out with the standard empty page (HTML)
(I think this is a repeatable pattern you can refine)
Then one by one, fill in the fields. If the elements are out of alignment,
you can adjust, using nbsp;, if you are not sure of the CSS...
take it one field at at time, and initially ignore the alignment
I suggest you make this base template your own, by using it, and adjusting it to your liking.
Moral of the story - You need a base Template that you can use over and over again.
<!-- Main Landing page rendered with Index.HTML--><tableclass="table"[mfData]="MyList"#mf="mfDataTable"[mfRowsOnPage]="7"><thead><tr><th><!--Field 1 --></th><!--Field 2 etc...--><th></th><th><!--Field 2 etc...--></th><th></th><th></th><th></th><th> Update</th><th> Delete </th></tr></thead><tbody><tr></tr></tbody><br/><br/><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td><button(click)="addRiverRun()"class="btn btn-secondary">Add NewRiver Run</button></td></tr><tfoot><tr><tdborder:0></td><td></td></tr></tfoot></table>
(Editor's note: I moved your example into a PRE block for readability)
you can adjust, using nbsp;,
I hate being a pedant about things like this, but please, no, never this. I get where you;re coming from (just get it done!) but aligning / layout is such an important (and relatively simple) skill to learn.
OK, while I'm at it, don't use tables. Use flexbox. I used to use tables because I specifically wanted a grid layout and browser support for divs and floats and all that was terrible. These days (and for a long time now) flex works on everything you'd need and it means your layout works on the desktop and your phone.
No sooner do you have something working well, someone will say "this looks rubbish on a phone" and you find yourself in a deep hole. Learn the basics and you'll never look back.
Just my 2c,
Last Visit: 23-Nov-20 12:52 Last Update: 23-Nov-20 12:52